mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Clear the list of ongoing syncs on shutdown
This commit is contained in:
parent
da491e75b2
commit
48340e4f13
@ -163,6 +163,8 @@ class SynchrotronPresence(object):
|
|||||||
UPDATE_SYNCING_USERS_MS,
|
UPDATE_SYNCING_USERS_MS,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
reactor.addSystemEventTrigger("before", "shutdown", self._on_shutdown)
|
||||||
|
|
||||||
def set_state(self, user, state):
|
def set_state(self, user, state):
|
||||||
# TODO Hows this supposed to work?
|
# TODO Hows this supposed to work?
|
||||||
pass
|
pass
|
||||||
@ -193,6 +195,13 @@ class SynchrotronPresence(object):
|
|||||||
|
|
||||||
defer.returnValue(_user_syncing())
|
defer.returnValue(_user_syncing())
|
||||||
|
|
||||||
|
@defer.inlineCallbacks
|
||||||
|
def _on_shutdown(self):
|
||||||
|
# When the synchrotron is shutdown tell the master to clear the in
|
||||||
|
# progress syncs for this process
|
||||||
|
self.user_to_num_current_syncs.clear()
|
||||||
|
yield self._send_syncing_users_now()
|
||||||
|
|
||||||
def _send_syncing_users_regularly(self):
|
def _send_syncing_users_regularly(self):
|
||||||
# Only send an update if we aren't in the middle of sending one.
|
# Only send an update if we aren't in the middle of sending one.
|
||||||
if not self._sending_sync:
|
if not self._sending_sync:
|
||||||
|
Loading…
Reference in New Issue
Block a user