diff options
author | Marko Kreen | 2009-11-03 12:26:19 +0000 |
---|---|---|
committer | Marko Kreen | 2009-11-03 12:43:44 +0000 |
commit | c9de6870b604e6aa99c42ef1ba12bc4b06c64a31 (patch) | |
tree | 2172028d318fa73f5d1647365153bb661b225318 /python/pgq/consumer.py | |
parent | 5c4ab947babf423aa83150f7eaaf5aec53a11a0b (diff) |
fix pgq brokenness related to recent commits
- get_batch_cursor()
- loop_delay
Diffstat (limited to 'python/pgq/consumer.py')
-rw-r--r-- | python/pgq/consumer.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/python/pgq/consumer.py b/python/pgq/consumer.py index ef6283d6..04915614 100644 --- a/python/pgq/consumer.py +++ b/python/pgq/consumer.py @@ -46,6 +46,7 @@ class _BatchWalker(object): self.curs = curs self.length = 0 self.status_map = {} + self.batch_id = batch_id self.fetch_status = 0 # 0-not started, 1-in-progress, 2-done def __iter__(self): @@ -54,7 +55,7 @@ class _BatchWalker(object): self.fetch_status = 1 q = "select * from pgq.get_batch_cursor(%s, %s, %s)" - self.curs.execute(q, [self.queue_name, self.sql_cursor, self.fetch_size]) + self.curs.execute(q, [self.batch_id, self.sql_cursor, self.fetch_size]) # this will return first batch of rows q = "fetch %d from batch_walker" % self.fetch_size @@ -167,7 +168,7 @@ class Consumer(skytools.DBScript): self.consumer_id = self.consumer_name def reload(self): - DBScript.reload(self) + skytools.DBScript.reload(self) self.pgq_lazy_fetch = self.cf.getint("pgq_lazy_fetch", self.default_lazy_fetch) # set following ones to None if not set |