Fix accounting in server 'status' command.

The calculations for the number of jobs in the queue and running
as reported by 'status' were incorrect.

Change-Id: I62bb9583c649b665bacc740a37e8f496f2720fc8
This commit is contained in:
James E. Blair 2013-06-12 17:00:36 -07:00
parent 218fe26a2c
commit b0953032ef

View File

@ -2188,13 +2188,10 @@ class Server(BaseClientServer):
for function in self.functions:
# Total, running, workers
functions[function] = [0, 0, 0]
for queue in [self.high_queue, self.normal_queue, self.low_queue]:
for job in queue:
functions[job.name][0] += 1
for job in self.jobs.values():
functions[job.name][0] += 1
functions[job.name][1] += 1
if job.running:
functions[job.name][1] += 1
for connection in self.active_connections:
for function in connection.functions:
functions[function][2] += 1