Skip to content

Commit

Permalink
Merge pull request #391 from ExaWorks/added_check_for_job_bound
Browse files Browse the repository at this point in the history
Added a simple check in `JobExecutor.submit()` to test if a job's
  • Loading branch information
hategan authored Jul 28, 2023
2 parents 887b02a + b36d9fe commit 331d446
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/psij/job_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def _check_job(self, job: Job) -> JobSpec:
raise TypeError('environment key "%s" has non-string value (%s)'
% (k, type(v).__name__))

if job.executor is not None:
raise InvalidJobException('Job is already associated with an executor')
job.executor = self
return spec

Expand Down

0 comments on commit 331d446

Please sign in to comment.