Skip to content

Commit 654b215

Browse files
committed
Fix using manual_stop while startup task is running
1 parent c93d24d commit 654b215

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mautrix/util/program.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ def _run(self) -> None:
214214
signal.signal(signal.SIGINT, signal.default_int_handler)
215215
signal.signal(signal.SIGTERM, signal.default_int_handler)
216216

217+
self._stop_task = self.loop.create_future()
217218
exit_code = 0
218219
try:
219220
self.log.debug("Running startup actions...")
@@ -224,7 +225,6 @@ def _run(self) -> None:
224225
f"Startup actions complete in {round(end_ts - start_ts, 2)} seconds, "
225226
"now running forever"
226227
)
227-
self._stop_task = self.loop.create_future()
228228
exit_code = self.loop.run_until_complete(self._stop_task)
229229
self.log.debug("manual_stop() called, stopping...")
230230
except KeyboardInterrupt:

0 commit comments

Comments
 (0)