FUNCTION_INVOCATION_TIMEOUT Error
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.
Possible way to implement it: https://stackoverflow.com/questions/56029972/return-for-function-after-certain-execution-time/56062464#56062464
Also move whole API calling into new function
- change axios cache to https://www.npmjs.com/package/axios-cache-interceptor?activeTab=readme
- make error message clear
- when user not found (400 status response)
- when user not found (400 status response)