Skip to content

Commit b36d9fe

Browse files
committed
Added a simple check in JobExecutor.submit() to test if a job's
executor property is already set (which would indicate that it was submitted before).
1 parent bc2bde5 commit b36d9fe

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/psij/job_executor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ def _check_job(self, job: Job) -> JobSpec:
105105
raise TypeError('environment key "%s" has non-string value (%s)'
106106
% (k, type(v).__name__))
107107

108+
if job.executor is not None:
109+
raise InvalidJobException('Job is already associated with an executor')
108110
job.executor = self
109111
return spec
110112

0 commit comments

Comments
 (0)