mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 03:53:52 +01:00
Fix dropping locks on shut down
This commit is contained in:
parent
97c8ae90f7
commit
83f1ccfcab
1 changed files with 5 additions and 1 deletions
|
@ -78,7 +78,11 @@ class LockStore(SQLBaseStore):
|
||||||
"""Called when the server is shutting down"""
|
"""Called when the server is shutting down"""
|
||||||
logger.info("Dropping held locks due to shutdown")
|
logger.info("Dropping held locks due to shutdown")
|
||||||
|
|
||||||
for (lock_name, lock_key), token in self._live_tokens.items():
|
# We need to take a copy of the tokens dict as dropping the locks will
|
||||||
|
# cause the dictionary to change.
|
||||||
|
tokens = dict(self._live_tokens)
|
||||||
|
|
||||||
|
for (lock_name, lock_key), token in tokens.items():
|
||||||
await self._drop_lock(lock_name, lock_key, token)
|
await self._drop_lock(lock_name, lock_key, token)
|
||||||
|
|
||||||
logger.info("Dropped locks due to shutdown")
|
logger.info("Dropped locks due to shutdown")
|
||||||
|
|
Loading…
Reference in a new issue