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
Conversation
That's a function, not a boolean we were evaluating so it always returned true. This fixes that.
core/src/server/server.ts
Outdated
@@ -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}`) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
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.
@@ -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()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What this PR does / why we need it:
That's a function, not a boolean we were evaluating so it always returned true. This fixes that.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: