mitodl / mitxonline

BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Set time limit for task process_google_sheet_requests #2261

Closed annagav closed 1 month ago

annagav commented 1 month ago

What are the relevant tickets?

Related to https://github.com/mitodl/hq/issues/4550

I looked at the logs for June 6th and this task was taking up to 4 minutes, and the schedule was set to run every minute.

Description (What does it do?)

sets a time limit on the task and sets the schedule to every 5 min. I am not sure what would be the best way to abort the task if it has exceeded the time limit.

How can this be tested?

Add this to the task and watch the logs:

 import time
 time.sleep(130)