mdgspace / codephile-backend

Back-end for Official Codephile App
https://codephile.mdg.iitr.ac.in/
16 stars 6 forks source link

Retry codeforces profile fetching and handle check #220

Closed prateek2211 closed 2 years ago

prateek2211 commented 3 years ago

Sometimes, codeforces API gives 502 error. So, it would be better to retry calling these APIs with some delay. Something like this is done in submission fetching. https://github.com/mdg-iitr/codephile-backend/blob/a9d465b390fa247e8a901a47733216f0d40b4928/scrappers/codeforces/scrapper.go#L83

If after all the retries, error still occurs. Then log the error in sentry, and return 502 error code in case of handle check API.