Merge pull request #359 from rockerbox/queue-patch
Fixed Queue to clear children before retry
This commit is contained in:
commit
2a3e9d19cd
|
@ -94,17 +94,13 @@ class Queue(BaseQueue):
|
|||
name = self._children[0]
|
||||
try:
|
||||
data, stat = self.client.get(self.path + "/" + name)
|
||||
self.client.delete(self.path + "/" + name)
|
||||
except NoNodeError: # pragma: nocover
|
||||
# the first node has vanished in the meantime, try to
|
||||
# get another one
|
||||
self._children = []
|
||||
raise ForceRetryError()
|
||||
try:
|
||||
self.client.delete(self.path + "/" + name)
|
||||
except NoNodeError: # pragma: nocover
|
||||
# we were able to get the data but someone else has removed
|
||||
# the node in the meantime. consider the item as processed
|
||||
# by the other process
|
||||
raise ForceRetryError()
|
||||
|
||||
self._children.pop(0)
|
||||
return data
|
||||
|
||||
|
|
Loading…
Reference in New Issue