Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5480 from matrix-org/erikj/extremities_dummy_events
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Feb 10, 2020
2 parents 537fe5e + e0be8d7 commit f98c652
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion synapse/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def is_soft_failed(self):
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
Expand Down
7 changes: 5 additions & 2 deletions synapse/handlers/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
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
Expand Down Expand Up @@ -265,9 +266,11 @@ def __init__(self, hs):
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,
)

Expand Down
2 changes: 1 addition & 1 deletion tests/storage/test_cleanup_extrems.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def test_send_dummy_event(self):
)
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)

Expand Down

0 comments on commit f98c652

Please sign in to comment.