-
-
Notifications
You must be signed in to change notification settings - Fork 736
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: maintenance mode should assume disable if db call fails. #6120
fix: maintenance mode should assume disable if db call fails. #6120
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Usually maintenance mode is disabled. If the call throws, which we see a lot of when a unleash instance is in terminating state, we should return a defualt value. By having it throw inside of the memoizee function, the response is not cached, and it will trigger new calls until it return a cachable result.
dcb50e0
to
f1bbef0
Compare
try { | ||
return ( | ||
this.config.flagResolver.isEnabled('maintenanceMode') || | ||
(await this.resolveMaintenance()) |
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.
by allowing the momizee function to throw, we unsure it will not be cached.
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.
LG!
@@ -193,7 +193,7 @@ export default class VersionService { | |||
)) ?? { id: undefined }; | |||
this.instanceId = id; | |||
} catch (err) { | |||
this.logger.warn('Could not find instanceInfo'); | |||
this.logger.warn('Could not find instanceInfo', err); |
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.
🥇
Usually maintenance mode is disabled. If the call throws, which we see a lot of when a unleash instance is in terminating state, we should return a default value. By having it throw inside of the memoizee function, the response is not cached, and it will trigger new calls until it return a cachable result.
Usually maintenance mode is disabled. If the call throws, which we see a lot of when a unleash instance is in terminating state, we should return a default value.
By having it throw inside of the memoizee function, the response is not cached, and it will trigger new calls until it return a cachable result.