sw-tools / checkin-service

Checks the user in to a flight
MIT License
9 stars 3 forks source link

Modified retrieval of basic/advanced headers #24

Open Rezer opened 2 years ago

Rezer commented 2 years ago

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

swtools0 commented 2 years ago

This looks like a terrific update, but I have a few suggestions about the implementation:

  1. Let's use a simple for loop for the retry logic rather than a while(true) loop. We can iterate until either the loop is done (max retries reached) or the headers successfully found.
  2. I would remove the 60s puppeteer timeout. In fact, we might want to decrease it rather than increase it now that we are retrying. I would assume that if it's taking longer than like 10s to load the page, that page is never going to load. Let me know if you observed in your testing that the page sometimes takes longer than 30s to load, but then actually successfully loads if it has 60s to wait.
  3. This project uses prettier and eslint. If you use VSCode, just install the project's recommended extensions, reload the window, and save your files. They should be auto-formatted by prettier.