File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ async def _cron_tasks(self, cron_tasks: list[TaskData]):
135
135
Handle all cron tasks
136
136
"""
137
137
138
- while True :
138
+ while not self . shutdown_event . is_set () :
139
139
# NOTE: Sleep until next exact time boundary (every minute)
140
140
current_time = utc_now ()
141
141
wait_time = timedelta (
@@ -333,12 +333,12 @@ async def run(self):
333
333
If there are no configured tasks to execute.
334
334
"""
335
335
336
- # NOTE: No need to display startup text, obvious from loading settings
337
- user_tasks = await self .startup ()
338
-
339
336
# NOTE: After startup, we need to gracefully shutdown
340
337
self .shutdown_event = asyncio .Event ()
341
338
339
+ # NOTE: No need to display startup text, obvious from loading settings
340
+ user_tasks = await self .startup ()
341
+
342
342
def exit_handler (signum , _frame ):
343
343
logger .info (f"{ signal .Signals (signum ).name } signal received" )
344
344
self .shutdown_event .set ()
You can’t perform that action at this time.
0 commit comments