Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwidman authored Sep 25, 2018
2 parents e005a10 + 7a8167d commit efbe658
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions kazoo/recipe/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,19 @@ def _take(self, id_):
id=id_),
self.id,
ephemeral=True)
except NodeExistsError:
# Item is already locked
return None

try:
value, stat = self.client.retry(
self.client.get,
"{path}/{id}".format(path=self._entries_path, id=id_))
except (NoNodeError, NodeExistsError):
# Item is already consumed or locked
except NoNodeError:
# Item is already consumed
self.client.delete(
"{path}/{id}".format(
path=self._lock_path,
id=id_))
return None
return (id_, value)

0 comments on commit efbe658

Please sign in to comment.