-
Notifications
You must be signed in to change notification settings - Fork 3
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
Modified retrieval of basic/advanced headers #24
base: master
Are you sure you want to change the base?
Conversation
Added up to 10 retries for basicHeaders and advancedHeaders within handle-scheduled-checkin.ts Increased puppeteer timeout to 60s within sw-generate-headers.ts
This looks like a terrific update, but I have a few suggestions about the implementation:
|
if(maxRetries <= 0) | ||
throw error; | ||
console.debug(`Failed getting ${headerName}. Retrying in 5s...\nException details: ${error}`) | ||
await waitMs(5000); |
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.
Add a comment about why we are waiting
} | ||
catch(error){ | ||
if(maxRetries <= 0) | ||
throw error; |
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.
Rather than throwing an error, just return here, then update the caller to check if the result is truthy. The handleInternal function should get to decide how to deal with headers not being found (probably throw an error there).
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.
Left feedback
Added up to 10 retries for basicHeaders and advancedHeaders within handle-scheduled-checkin.ts
Increased puppeteer timeout to 60s within sw-generate-headers.ts
Resolves #23