summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-10 18:56:49 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-10 18:56:49 +0000
commitf98c652b4ed54bf882f36b898bff8d23084aa841 (patch)
tree5eb0c6c72b8852949fc9e60c8606093385509dcd
parentMerge pull request #5490 from matrix-org/rav/xmlsec_in_docker (diff)
parentMerge pull request #5480 from matrix-org/erikj/extremities_dummy_events (diff)
downloadsynapse-f98c652b4ed54bf882f36b898bff8d23084aa841.tar.xz
Merge pull request #5480 from matrix-org/erikj/extremities_dummy_events
-rw-r--r--synapse/events/__init__.py2
-rw-r--r--synapse/handlers/message.py7
-rw-r--r--tests/storage/test_cleanup_extrems.py2
3 files changed, 7 insertions, 4 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py

index f1fbb3d14a..7154bcbea6 100644 --- a/synapse/events/__init__.py +++ b/synapse/events/__init__.py
@@ -93,7 +93,7 @@ class _EventInternalMetadata(object): return getattr(self, "soft_failed", False) def should_proactively_send(self): - """Whether the eventm, if ours, should be sent to other clients and + """Whether the event, if ours, should be sent to other clients and servers. This is used for sending dummy events internally. Servers and clients diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index af3df736d9..a212ca0b0e 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py
@@ -34,6 +34,7 @@ from synapse.api.errors import ( from synapse.api.room_versions import RoomVersions from synapse.api.urls import ConsentURIBuilder from synapse.events.validator import EventValidator +from synapse.metrics.background_process_metrics import run_as_background_process from synapse.replication.http.send_event import ReplicationSendEventRestServlet from synapse.storage.state import StateFilter from synapse.types import RoomAlias, UserID, create_requester @@ -265,9 +266,11 @@ class EventCreationHandler(object): not self.config.worker_app and self.config.cleanup_extremities_with_dummy_events ): - # XXX: Send dummy events. self.clock.looping_call( - self._send_dummy_events_to_fill_extremities, + lambda: run_as_background_process( + "send_dummy_events_to_fill_extremities", + self._send_dummy_events_to_fill_extremities + ), 5 * 60 * 1000, ) diff --git a/tests/storage/test_cleanup_extrems.py b/tests/storage/test_cleanup_extrems.py
index ed5d58f58c..e9e2d5337c 100644 --- a/tests/storage/test_cleanup_extrems.py +++ b/tests/storage/test_cleanup_extrems.py
@@ -255,7 +255,7 @@ class CleanupExtremDummyEventsTestCase(HomeserverTestCase): ) self.assertEqual(len(latest_event_ids), 50) - # Bump the reacto repeatedly so that the background updates have a + # Pump the reactor repeatedly so that the background updates have a # chance to run. self.pump(10 * 60)