Skip to content

Commit

Permalink
pgq: Consumer class also need _make_event, for _load_batch_events_old()
Browse files Browse the repository at this point in the history
  • Loading branch information
markokr committed Jun 20, 2013
1 parent 9e72e08 commit 53151b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/pgq/baseconsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ def unregister_consumer(self):
def _launch_process_batch(self, db, batch_id, list):
self.process_batch(db, batch_id, list)

def _make_event(self, queue_name, row):
return Event(queue_name, row)

def _load_batch_events_old(self, curs, batch_id):
"""Fetch all events for this batch."""

Expand All @@ -298,7 +301,7 @@ def _load_batch_events_old(self, curs, batch_id):
# map them to python objects
ev_list = []
for r in rows:
ev = Event(self.queue_name, r)
ev = self._make_event(self.queue_name, r)
ev_list.append(ev)

return ev_list
Expand Down
3 changes: 3 additions & 0 deletions python/pgq/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class Consumer(BaseConsumer):

_batch_walker_class = RetriableBatchWalker

def _make_event(self, queue_name, row):
return RetriableWalkerEvent(self, queue_name, row)

def _flush_retry(self, curs, batch_id, list):
"""Tag retry events."""

Expand Down

0 comments on commit 53151b6

Please sign in to comment.