Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

v 0.6 - more priority queue bugfixes

  • Loading branch information...
commit 0700770d2e0667cb0f4030e53e41c61753ed84cd 1 parent a854a32
Dave McLain authored
Showing with 3 additions and 9 deletions.
  1. +1 −1  scrapy_heroku/__init__.py
  2. +2 −8 scrapy_heroku/spiderqueue.py
2  scrapy_heroku/__init__.py
View
@@ -1,2 +1,2 @@
-__version__ = (0, 5, 0)
+__version__ = (0, 6, 0)
10 scrapy_heroku/spiderqueue.py
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.