RedHeadphone / codeforces-readme-stats

⚡ Dynamically generated Codeforces stats for your Github profile!
https://codeforces-readme-stats.vercel.app
MIT License
56 stars 7 forks source link

FUNCTION_INVOCATION_TIMEOUT Error #6

Closed RedHeadphone closed 3 months ago

RedHeadphone commented 1 year ago

Whenever Codeforces contests are live, their API gets slow, and as a result, my API gives FUNCTION_INVOCATION_TIMEOUT error because of the Vercel limits.

One solution to that can be a custom API cache adapter at the backend to cache codeforces API that saves the last 200 response data separately along with a time limit for temporary cache. So when data is not found in the temporary cache, it calls API, and if API gives an error or takes more than some seconds, it returns the last 200 response data.

RedHeadphone commented 1 year ago

Possible way to implement it: https://stackoverflow.com/questions/56029972/return-for-function-after-certain-execution-time/56062464#56062464

RedHeadphone commented 3 months ago

Also move whole API calling into new function