Skip to content

Commit

Permalink
Modify the on_message function to be usable from AlephWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
catileptic committed Jun 5, 2024
1 parent d6d6129 commit 8bd4082
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions servicelayer/taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ def on_message(self, channel, method, properties, body, args):
"""
connection = args[0]
task = get_task(body, method.delivery_tag)
# the task needs to be acknowledged in the same channel that it was
# received. So store the channel. This is useful when executing batched
# indexing tasks since they are acknowledged late.
task._channel = channel
self.local_queue.put((task, channel, connection))

def process_blocking(self):
Expand Down

0 comments on commit 8bd4082

Please sign in to comment.