mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-16 23:11:34 +01:00
Fix v2 sync, update the last_notified_ms only if there was an active listener
This commit is contained in:
parent
5e0c533672
commit
3edd2d5c93
2 changed files with 7 additions and 6 deletions
|
@ -92,7 +92,7 @@ class SyncHandler(BaseHandler):
|
||||||
result = yield self.current_sync_for_user(sync_config, since_token)
|
result = yield self.current_sync_for_user(sync_config, since_token)
|
||||||
defer.returnValue(result)
|
defer.returnValue(result)
|
||||||
else:
|
else:
|
||||||
def current_sync_callback():
|
def current_sync_callback(before_token, after_token):
|
||||||
return self.current_sync_for_user(sync_config, since_token)
|
return self.current_sync_for_user(sync_config, since_token)
|
||||||
|
|
||||||
rm_handler = self.hs.get_handlers().room_member_handler
|
rm_handler = self.hs.get_handlers().room_member_handler
|
||||||
|
|
|
@ -81,10 +81,11 @@ class _NotifierUserStream(object):
|
||||||
self.last_notified_ms = time_now_ms
|
self.last_notified_ms = time_now_ms
|
||||||
|
|
||||||
def notify(self, stream_key, stream_id, time_now_ms):
|
def notify(self, stream_key, stream_id, time_now_ms):
|
||||||
self.last_notified_ms = time_now_ms
|
|
||||||
self.current_token = self.current_token.copy_and_replace(
|
self.current_token = self.current_token.copy_and_replace(
|
||||||
stream_key, stream_id
|
stream_key, stream_id
|
||||||
)
|
)
|
||||||
|
if self.listeners:
|
||||||
|
self.last_notified_ms = time_now_ms
|
||||||
listeners = self.listeners
|
listeners = self.listeners
|
||||||
self.listeners = set()
|
self.listeners = set()
|
||||||
for listener in listeners:
|
for listener in listeners:
|
||||||
|
|
Loading…
Reference in a new issue