Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): ensure needsReload flag works #5211

Merged
merged 2 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/server/instance-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export class GardenInstanceManager {

// Flag the instance for reloading when configs change
garden.events.once("configChanged", (_payload) => {
if (!garden.needsReload) {
if (!garden.needsReload()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there possibly a linter rule that catches these kinds of bugs? @TimBeyer @eysi09

garden.needsReload(true)
garden.log.info(
chalk.magenta.bold(
Expand Down
2 changes: 1 addition & 1 deletion core/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ export class GardenServer extends EventEmitter {
} catch (error) {
errors.push(toGardenError(error))
} finally {
loadConfigLog.success(`Loading config failed with error: ${errors[0].message}`)
loadConfigLog.error(`Loading config failed with error: ${errors[0].message}`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it possible that errors is empty when the interpreter runs this line of code?
The finally block will run even when no error has been catched in this try/catch clause.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible that this line of code should be above the line 894?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, revoking my approval 😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha on closer inspection this code doesn't make sense at all. I just noticed we were using success to print something that looked like an error but didn't look at the overall flow. My intention I was basically just to fix a typo.

I'll update though.

await cloudEventStream.close() // Note: This also flushes events
send(
"commandResult",
Expand Down