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

Commit

Permalink
fix delete_existing for _persist_events (#6300)
Browse files Browse the repository at this point in the history
  • Loading branch information
anoadragon453 committed Mar 16, 2020
2 parents 44b1bc5 + 0467f33 commit 7f482b7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/6300.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move `persist_events` out from main data store.
2 changes: 1 addition & 1 deletion synapse/storage/data_stores/main/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _retry_on_integrity_error(func):
@defer.inlineCallbacks
def f(self, *args, **kwargs):
try:
res = yield func(self, *args, **kwargs)
res = yield func(self, *args, delete_existing=False, **kwargs)
except self.database_engine.module.IntegrityError:
logger.exception("IntegrityError, retrying.")
res = yield func(self, *args, delete_existing=True, **kwargs)
Expand Down
5 changes: 1 addition & 4 deletions synapse/storage/persist_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,7 @@ def persisting_queue(item):
self._event_persist_queue.handle_queue(room_id, persisting_queue)

@defer.inlineCallbacks
def _persist_events(
self, events_and_contexts, backfilled=False, delete_existing=False
):
def _persist_events(self, events_and_contexts, backfilled=False):
"""Calculates the change to current state and forward extremities, and
persists the given events and with those updates.
Expand Down Expand Up @@ -412,7 +410,6 @@ def _persist_events(
state_delta_for_room=state_delta_for_room,
new_forward_extremeties=new_forward_extremeties,
backfilled=backfilled,
delete_existing=delete_existing,
)

@defer.inlineCallbacks
Expand Down

0 comments on commit 7f482b7

Please sign in to comment.