File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,9 @@ def _run(self) -> None:
197197 self .log .debug (f"Startup actions complete in { round (end_ts - start_ts , 2 )} seconds, "
198198 "now running forever" )
199199 self .az .ready = True
200- self .loop .run_forever ()
200+ self ._stop_task = self .loop .create_future ()
201+ self .loop .run_until_complete (self ._stop_task )
202+ self .log .debug ("manual_stop() called, stopping..." )
201203 except KeyboardInterrupt :
202204 self .log .debug ("Interrupt received, stopping..." )
203205 except Exception :
@@ -233,3 +235,6 @@ async def stop(self) -> None:
233235 def prepare_shutdown (self ) -> None :
234236 """Lifecycle method that is called right before ``sys.exit(0)``."""
235237 pass
238+
239+ def manual_stop (self ) -> None :
240+ self ._stop_task .set_result (None )
You can’t perform that action at this time.
0 commit comments