Cleaner consumers
This commit is contained in:
parent
e5741ce1cb
commit
a8ce37a372
2 changed files with 11 additions and 9 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue