File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -100,12 +100,14 @@ class TaskScheduler:
100100 # Time before a complete or failed task is deleted from the DB
101101 KEEP_TASKS_FOR_MS = 7 * 24 * 60 * 60 * 1000 # 1 week
102102 # Maximum number of tasks that can run at the same time
103- MAX_CONCURRENT_RUNNING_TASKS = 5
103+ MAX_CONCURRENT_RUNNING_TASKS = 1 # Beep: temporarily changed from 5
104104 # Time from the last task update after which we will log a warning
105105 LAST_UPDATE_BEFORE_WARNING_MS = 24 * 60 * 60 * 1000 # 24hrs
106106 # Report a running task's status and usage every so often.
107107 OCCASIONAL_REPORT_INTERVAL_MS = 5 * 60 * 1000 # 5 minutes
108108
109+ SLEEP_AFTER_TASK_S = 1
110+
109111 def __init__ (self , hs : "HomeServer" ):
110112 self ._hs = hs
111113 self .server_name = (
@@ -456,6 +458,10 @@ async def wrapper() -> None:
456458 result = None
457459 error = f .getErrorMessage ()
458460
461+ # Beep: sleep before we remove/complete the running task
462+ if TaskScheduler .SLEEP_AFTER_TASK_S > 0 :
463+ await self ._clock .sleep (TaskScheduler .SLEEP_AFTER_TASK_S )
464+
459465 await self ._store .update_scheduled_task (
460466 task .id ,
461467 self ._clock .time_msec (),
You can’t perform that action at this time.
0 commit comments