mirror of
https://github.com/maubot/maubot
synced 2025-09-07 22:00:39 +00:00
Add some backup checks when stopping maubot
This commit is contained in:
parent
20a9ca6aa6
commit
6f2162d5f3
3 changed files with 10 additions and 3 deletions
|
@ -90,7 +90,10 @@ except KeyboardInterrupt:
|
|||
log.debug("Closing websockets")
|
||||
loop.run_until_complete(stop_management_api())
|
||||
log.debug("Stopping server")
|
||||
loop.run_until_complete(server.stop())
|
||||
try:
|
||||
loop.run_until_complete(asyncio.wait_for(server.stop(), 5, loop=loop))
|
||||
except asyncio.TimeoutError:
|
||||
log.warning("Stopping server timed out")
|
||||
log.debug("Closing event loop")
|
||||
loop.close()
|
||||
log.debug("Everything stopped, shutting down")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue