summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier 'reivilibre <oliverw@matrix.org>2024-07-09 21:25:06 +0100
committerOlivier 'reivilibre <oliverw@matrix.org>2024-07-09 21:28:18 +0100
commitb6e944140951ea4ed6e69a672c6bc0273491aa17 (patch)
tree852474dd82b6b159ec0fe2f731122d83f66fa9ab
parentMerge branch 'release-v1.111' into matrix-org-hotfixes (diff)
downloadsynapse-b6e944140951ea4ed6e69a672c6bc0273491aa17.tar.xz
Only log once when waiting for current token to catch up
Rather than once every 0.5s
-rw-r--r--synapse/notifier.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/notifier.py b/synapse/notifier.py
index c3ecf86ec4..7a2b54036c 100644
--- a/synapse/notifier.py
+++ b/synapse/notifier.py
@@ -773,6 +773,7 @@ class Notifier:
         stream_token = await self.event_sources.bound_future_token(stream_token)
 
         start = self.clock.time_msec()
+        logged = False
         while True:
             current_token = self.event_sources.get_current_token()
             if stream_token.is_before_or_eq(current_token):
@@ -783,11 +784,13 @@ class Notifier:
             if now - start > 10_000:
                 return False
 
-            logger.info(
-                "Waiting for current token to reach %s; currently at %s",
-                stream_token,
-                current_token,
-            )
+            if not logged:
+                logger.info(
+                    "Waiting for current token to reach %s; currently at %s",
+                    stream_token,
+                    current_token,
+                )
+                logged = True
 
             # TODO: be better
             await self.clock.sleep(0.5)