Add timeout for exit-settting-offline
This commit is contained in:
parent
4784c80ed9
commit
a17daf61c8
|
@ -311,10 +311,17 @@ class MatrixClient(nio.AsyncClient):
|
|||
await self._stop()
|
||||
|
||||
if self._presence != "offline":
|
||||
await self.set_presence("offline", save=False)
|
||||
try:
|
||||
await asyncio.wait_for(
|
||||
self.set_presence("offline", save=False),
|
||||
timeout = 10,
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
log.warn("%s timed out", self.user_id)
|
||||
else:
|
||||
log.info("%s termined", self.user_id)
|
||||
|
||||
await self.close()
|
||||
log.info("%s termined", self.user_id)
|
||||
|
||||
@property
|
||||
def syncing(self) -> bool:
|
||||
|
|
Loading…
Reference in New Issue
Block a user