1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/handlers/stats.py b/synapse/handlers/stats.py
index 8393f4a439..7e69e8eaa8 100644
--- a/synapse/handlers/stats.py
+++ b/synapse/handlers/stats.py
@@ -50,7 +50,7 @@ class StatsHandler:
# Guard to ensure we only process deltas one at a time
self._is_processing = False
- if hs.config.stats_enabled:
+ if self.stats_enabled and hs.config.run_background_tasks:
self.notifier.add_replication_callback(self.notify_new_event)
# We kick this off so that we don't have to wait for a change before
|