civictechsweden / JagVillHaVaccin

A website to show available times in vaccination centers across Sweden
https://jagvillhavaccin.nu
GNU Affero General Public License v3.0
17 stars 4 forks source link

Make sure the script doesn't crash when a HTTP request fails #4

Closed PierreMesure closed 3 years ago

PierreMesure commented 3 years ago

Problem

My code isn't super smart, it fails when the data isn't received from a center's API. That stops the script and even the subsequent regions.

It's no big deal because that doesn't happen enough (only when the rate limitation is reached on MittVaccin so far) but it could easily be fixed.

Suggested solution

Implement a simple retry after a few seconds? Skip the center? The latter might not work since other centers which use the same platform will fail as well.

PierreMesure commented 3 years ago

This is fixed with a retry and a skip if fetching data fails permanently 😊