diff options
author | Marko Kreen | 2009-09-09 10:52:58 +0000 |
---|---|---|
committer | Marko Kreen | 2009-09-09 10:52:58 +0000 |
commit | 8647a60005315bf0c15c966213322ea1baf7bff6 (patch) | |
tree | abc9bb744cc1efb5e783321cfb09e75b97635cb0 /python/pgq/consumer.py | |
parent | e436a281174fce7b16e1a2dd837e5003a7faa097 (diff) |
pgq.CoopConsumer for Python
Simply wrapper around Consumer which redirects few calls to pgq_coop schema.
Diffstat (limited to 'python/pgq/consumer.py')
-rw-r--r-- | python/pgq/consumer.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python/pgq/consumer.py b/python/pgq/consumer.py index a23b882e..32fa9f76 100644 --- a/python/pgq/consumer.py +++ b/python/pgq/consumer.py @@ -245,8 +245,8 @@ class Consumer(skytools.DBScript): curs.execute(q, [self.queue_name, self.consumer_name]) return curs.fetchone()[0] - def _finish_batch(self, curs, batch_id, list): - """Tag events and notify that the batch is done.""" + def _flush_retry(self, curs, list): + """Tag retry events.""" retry = 0 if self.pgq_lazy_fetch: @@ -269,6 +269,11 @@ class Consumer(skytools.DBScript): if retry: self.stat_increase('retry-events', retry) + def _finish_batch(self, curs, batch_id, list): + """Tag events and notify that the batch is done.""" + + self._flush_retry(curs, batch_id, list) + curs.execute("select pgq.finish_batch(%s)", [batch_id]) def _tag_retry(self, cx, batch_id, ev_id, retry_time): |