Cleaner consumers

This commit is contained in:
nemunaire 2014-07-17 12:01:04 +02:00
parent e5741ce1cb
commit a8ce37a372
2 changed files with 11 additions and 9 deletions

View file

@ -136,8 +136,10 @@ class Consumer(threading.Thread):
while not self.stop:
stm = self.context.cnsr_queue.get(True, 20)
stm.run(self.context)
self.context.cnsr_queue.task_done()
except queue.Empty:
pass
finally:
self.context.cnsr_thrd_size -= 2
self.context.cnsr_thrd.remove(self)