I currently have a python script that has a for loop that is triggered by an entry into my MongoDb databased. The script does some calculations before printing the results to a Google Sheet. The loop could be triggered every hour or in some cases, several times per second. This issue I’m facing is that the Google API has usage limits that are occasionally being exceeded and thus breaking the loop.
What I want to do, is use some code that will attempt to print the results to Google Sheets using Google’s API but if there’s a usage limit, sleep for 2 minutes before resuming, instead of breaking the loop because of the error.
Can anyone recommend where to start?
>Solution :
I would use try to save to sheet and except to sleep 2 mins then save to sheet