Skip to content

Commit

Permalink
daemon: ignore duplicate actions
Browse files Browse the repository at this point in the history
  • Loading branch information
aaxelb committed Feb 15, 2021
1 parent 7dc6188 commit 6b0b9e9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions share/search/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,13 @@ def action_chunk_iter(self):
for _ in range(self.chunk_size):
try:
message, action = self.action_queue.get(timeout=LOOP_TIMEOUT)
if action is None or '_id' not in action:
if (
action is None
or '_id' not in action
or action['_id'] in self.messages_awaiting_elastic
):
message.ack()
continue
if action['_id'] in self.messages_awaiting_elastic:
# should have been deduped in IncomingMessageLoop
raise DaemonMessageError('duplicate messages in one chunk -- should not happen')
self.messages_awaiting_elastic[str(action['_id'])] = message
yield action
except local_queue.Empty:
Expand Down

0 comments on commit 6b0b9e9

Please sign in to comment.