Permalink
Browse files

v 0.6 - more priority queue bugfixes

  • Loading branch information...
1 parent a854a32 commit 0700770d2e0667cb0f4030e53e41c61753ed84cd @dmclain committed Nov 20, 2012
Showing with 3 additions and 9 deletions.
  1. +1 −1 scrapy_heroku/__init__.py
  2. +2 −8 scrapy_heroku/spiderqueue.py
@@ -1,2 +1,2 @@
-__version__ = (0, 5, 0)
+__version__ = (0, 6, 0)
@@ -56,10 +56,7 @@ def pop(self):
return
mid, msg = results[0]
q = "delete from %s where id=%%s;" % self.table
- results = self._execute(q, (mid,), results=False)
- if not results: # record vanished, so let's try again
- self.conn.rollback()
- return self.pop()
+ self._execute(q, (mid,), results=False)
self.conn.commit()
return self.decode(msg)
@@ -69,10 +66,7 @@ def remove(self, func):
for mid, msg in self.conn.execute(q):
if func(self.decode(msg)):
q = "delete from %s where id=%%s" % self.table
- c = self._execute(q, (mid,), results=False)
- if not c: # record vanished, so let's try again
- self.conn.rollback()
- return self.remove(func)
+ self._execute(q, (mid,), results=False)
n += 1
self.conn.commit()
return n

0 comments on commit 0700770

Please sign in to comment.