mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-18 17:10:43 +03:00
Only log once when waiting for current token to catch up
Rather than once every 0.5s
This commit is contained in:
parent
ca66648b11
commit
b6e9441409
1 changed files with 8 additions and 5 deletions
|
@ -773,6 +773,7 @@ class Notifier:
|
||||||
stream_token = await self.event_sources.bound_future_token(stream_token)
|
stream_token = await self.event_sources.bound_future_token(stream_token)
|
||||||
|
|
||||||
start = self.clock.time_msec()
|
start = self.clock.time_msec()
|
||||||
|
logged = False
|
||||||
while True:
|
while True:
|
||||||
current_token = self.event_sources.get_current_token()
|
current_token = self.event_sources.get_current_token()
|
||||||
if stream_token.is_before_or_eq(current_token):
|
if stream_token.is_before_or_eq(current_token):
|
||||||
|
@ -783,11 +784,13 @@ class Notifier:
|
||||||
if now - start > 10_000:
|
if now - start > 10_000:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
logger.info(
|
if not logged:
|
||||||
"Waiting for current token to reach %s; currently at %s",
|
logger.info(
|
||||||
stream_token,
|
"Waiting for current token to reach %s; currently at %s",
|
||||||
current_token,
|
stream_token,
|
||||||
)
|
current_token,
|
||||||
|
)
|
||||||
|
logged = True
|
||||||
|
|
||||||
# TODO: be better
|
# TODO: be better
|
||||||
await self.clock.sleep(0.5)
|
await self.clock.sleep(0.5)
|
||||||
|
|
Loading…
Reference in a new issue