Skip to content

Commit cd8a2b4

Browse files
committed
set the job id after submission
1 parent 28a2cc9 commit cd8a2b4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pyfgaws/batch/api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def add_to_kwargs(key: str, value: Optional[Any]) -> None:
279279
add_to_kwargs(key="retryStrategy", value=self.retry_strategy)
280280
add_to_kwargs(key="timeout", value=self.timeout)
281281

282-
return self.client.submit_job(
282+
response = self.client.submit_job(
283283
jobName=self.name,
284284
jobQueue=self.queue,
285285
jobDefinition=self.job_definition_arn,
@@ -293,6 +293,11 @@ def add_to_kwargs(key: str, value: Optional[Any]) -> None:
293293
# timeout=None,
294294
)
295295

296+
# Don't forget to set the job id
297+
self.job_id = response["jobId"]
298+
299+
return response
300+
296301
def _reason(self, reason: Optional[str] = None) -> str:
297302
"""The default reason for cancelling or terminating a job"""
298303
return reason if reason is not None else "manually initiated"

0 commit comments

Comments
 (0)