Skip to content

Commit

Permalink
Fix using manual_stop while startup task is running
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jun 25, 2023
1 parent c93d24d commit 654b215
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mautrix/util/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def _run(self) -> None:
signal.signal(signal.SIGINT, signal.default_int_handler)
signal.signal(signal.SIGTERM, signal.default_int_handler)

self._stop_task = self.loop.create_future()
exit_code = 0
try:
self.log.debug("Running startup actions...")
Expand All @@ -224,7 +225,6 @@ def _run(self) -> None:
f"Startup actions complete in {round(end_ts - start_ts, 2)} seconds, "
"now running forever"
)
self._stop_task = self.loop.create_future()
exit_code = self.loop.run_until_complete(self._stop_task)
self.log.debug("manual_stop() called, stopping...")
except KeyboardInterrupt:
Expand Down

0 comments on commit 654b215

Please sign in to comment.