Merge pull request #359 from rockerbox/queue-patch

Fixed Queue to clear children before retry
This commit is contained in:
Ben Bangert 2017-05-31 13:37:05 -07:00 committed by GitHub
commit 2a3e9d19cd
1 changed files with 3 additions and 7 deletions

View File

@ -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