Skip to content

Commit

Permalink
tethys-138 Jobs Table - pending jobs breaks run_time
Browse files Browse the repository at this point in the history
Issue #138
  • Loading branch information
sdc50 committed Nov 14, 2015
1 parent 4d1af1c commit 5e1b52c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tethys_compute/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ def execute(self, *args, **kwargs):
"""
self.execute_time = timezone.now()
self._status = 'PEN'
self.save()
self.child._execute(*args, **kwargs)

Expand Down Expand Up @@ -471,6 +472,10 @@ def condorpy_job(self):
private_key=None
private_key_pass=None

attributes = dict()
attributes.update(self.attributes)
attributes.pop('remote_input_files', None)

job = Job(name=self.name.replace(' ', '_'),
attributes=self.condorpy_template,
executable=self.executable,
Expand All @@ -481,7 +486,7 @@ def condorpy_job(self):
private_key_pass=private_key_pass,
remote_input_files=self.remote_input_files,
working_directory=self.workspace,
**self.attributes)
**attributes)

job._cluster_id = self.cluster_id
job._num_jobs = self.num_jobs
Expand All @@ -501,6 +506,8 @@ def initial_dir(self):
return os.path.join(self.workspace, self.condorpy_job.initial_dir)

def _update_status(self):
if not self.execute_time:
return 'PEN'
try:
condor_status = self.condorpy_job.status
if condor_status == 'Various':
Expand Down

0 comments on commit 5e1b52c

Please sign in to comment.