I help out some Twitch streamers with commands for their chatbots to get information about players' ratings, arenas, etc. As had been recommended to me by someone a few years ago, I host some Python scripts on Google Cloud Functions, so that the bot command calls my script, the script queries the Lichess API, parses the information, and then passes the result as plain text back to the bot to display in chat.
This has been working fine for quite some time, but recently I've noticed the commands are often timing out in Google Cloud Functions (i.e. taking longer than 1 minute), which is in turn causing the bot to throw an error. Since I haven't encountered the same issue when using the same functions to call the chesscom API instead, I don't think the problem is with the chat bot or the Google Cloud Functions.
This has mostly been happening with my arena command, which gives information about a team's current arenas: it uses the /api/team/{teamID}/arena endpoint to find the tournament IDs, and then the /api/tournament/{tournamentID} endpoints to retrieve information about a specific tournament. However, the timeouts have also occasionally appeared when using a rating command to look up ratings, which uses the /api/user/{username} endpoint, and with a head-to-head command, which calls /api/crosstable/{player1}/{player2}.
These commands all used to work smoothly, but I've noticed these timeouts occurring in the past month or so - I'm afraid I don't remember exactly when they started. I haven't changed anything in my script, so I was wondering if anyone has any idea what might be causing them, and how I could fix them? Thanks in advance!