Skip to content

Commit

Permalink
Filter out jobs on non normal waiting state when looking for oldest w…
Browse files Browse the repository at this point in the history
…aiting job
  • Loading branch information
Mich committed Jan 29, 2015
1 parent 89cd84e commit 5358527
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions starcluster/balancers/sge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,11 @@ def slots_per_host(self):

def oldest_queued_job_age(self):
"""
This returns the age of the oldest job in the queue
This returns the age of the oldest job in the queue in normal waiting
state
"""
for j in self.jobs:
if 'JB_submission_time' in j:
if 'JB_submission_time' in j and j['state'] == 'qw':
st = j['JB_submission_time']
dt = utils.iso_to_datetime_tuple(st)
return dt.replace(tzinfo=self.remote_tzinfo)
Expand Down

0 comments on commit 5358527

Please sign in to comment.