Skip to content

Commit

Permalink
Fix enqueue race condition. (slimta#107)
Browse files Browse the repository at this point in the history
Sometimes emails in the queue will already have been processed before the first attempt here.
  • Loading branch information
brycedrennan authored and icgood committed Sep 15, 2016
1 parent aced65a commit b0e03a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slimta/queue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def enqueue(self, envelope):
results = list(zip(envelopes, ids))
for env, id in results:
if not isinstance(id, BaseException):
if self.relay:
if self.relay and id not in self.active_ids:
self.active_ids.add(id)
self._pool_spawn('relay', self._attempt, id, env, 0)
elif not isinstance(id, QueueError):
Expand Down

0 comments on commit b0e03a1

Please sign in to comment.