-
Notifications
You must be signed in to change notification settings - Fork 16
added a delay to check failing test cases #2002
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
base: development
Are you sure you want to change the base?
Conversation
@@ -52,6 +52,10 @@ class AuthenticationHandler { | |||
} | |||
|
|||
async refreshAccessToken(error: any, maxRetryCount = 1): Promise<void> { | |||
// Add delay to prevent burst requests and help diagnose GoCD pipeline failures | |||
console.log('Adding delay before processing refreshAccessToken...'); |
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.
@naman-contentstack adding log will display in production as well, this wont be a right message to be printed in prod
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.
@naman-contentstack, can this be applied for the development environment only, since this will affect production users?
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.
Avoid using console logs.
Also, use environment-specific code with a logger or setTimeout
@@ -52,6 +52,10 @@ class AuthenticationHandler { | |||
} | |||
|
|||
async refreshAccessToken(error: any, maxRetryCount = 1): Promise<void> { | |||
// Add delay to prevent burst requests and help diagnose GoCD pipeline failures | |||
console.log('Adding delay before processing refreshAccessToken...'); | |||
await new Promise((resolve) => setTimeout(resolve, 2000)); // 2 second delay |
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.
I would suggest
if(process.env.environment === "development"){
// add code here
}
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.
await new Promise((resolve) => setTimeout(resolve, 2000));
can be - await new Promise((resolve) => setTimeout(resolve, process.env.DELAY || 2000));
in any case if we wants to increase or decrease the delay
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.
@naman-contentstack, can this be applied for the development environment only, since this will affect production users?
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.
Avoid using console logs.
Also, use environment-specific code with a logger or setTimeout
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.
@netrajpatel The issue was found in the prod e2e, we have discussed an action plan on the basis of env config so that the end user wont be affected
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.
Avoid using console logs.
Also, use environment-specific code with a logger or setTimeout
No description provided.