Fix bug in Arbiter.manage_workers.

My fix yesterday was broken when sorting workers. Thanks to
Sabin Iacob for the report.
This commit is contained in:
Paul J. Davis 2011-06-15 09:20:20 -04:00
parent 6d69509bb6
commit 0923a52171

View File

@ -420,7 +420,7 @@ class Arbiter(object):
self.spawn_workers()
workers = self.WORKERS.items()
workers.sort(key=lambda w: w.age)
workers.sort(key=lambda w: w[1].age)
while len(workers) > self.num_workers:
(pid, _) = workers.pop(0)
self.kill_worker(pid, signal.SIGQUIT)