Skip to content

Commit

Permalink
Merge pull request #492 from datacratic/queue_check_only_normal_wait
Browse files Browse the repository at this point in the history
Queue check only normal wait
  • Loading branch information
jtriley committed Jan 30, 2015
2 parents 3c9b461 + d29aebc commit ca9d1b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions starcluster/balancers/sge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def get_queued_jobs(self):
"""
queued = []
for j in self.jobs:
if j['job_state'] == u'pending':
if j['job_state'] == u'pending' and j['state'] == u'qw':
queued.append(j)
return queued

Expand Down 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 ca9d1b8

Please sign in to comment.