1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index a622a600b4..66b46bd59f 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -403,8 +403,10 @@ class EventCreationHandler(object):
if self._block_events_without_consent_error:
self._consent_uri_builder = ConsentURIBuilder(self.config)
+ self._is_worker_app = self.config.worker_app is not None
+
if (
- not self.config.worker_app
+ not self._is_worker_app
and self.config.cleanup_extremities_with_dummy_events
):
self.clock.looping_call(
@@ -824,7 +826,7 @@ class EventCreationHandler(object):
success = False
try:
# If we're a worker we need to hit out to the master.
- if self.config.worker_app:
+ if self._is_worker_app:
await self.send_event_to_master(
event_id=event.event_id,
store=self.store,
@@ -890,7 +892,7 @@ class EventCreationHandler(object):
This should only be run on master.
"""
- assert not self.config.worker_app
+ assert not self._is_worker_app
if ratelimit:
# We check if this is a room admin redacting an event so that we
|