Skip to content

Commit

Permalink
set the job id after submission
Browse files Browse the repository at this point in the history
  • Loading branch information
nh13 committed Jun 11, 2020
1 parent 28a2cc9 commit cd8a2b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyfgaws/batch/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def add_to_kwargs(key: str, value: Optional[Any]) -> None:
add_to_kwargs(key="retryStrategy", value=self.retry_strategy)
add_to_kwargs(key="timeout", value=self.timeout)

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

# Don't forget to set the job id
self.job_id = response["jobId"]

return response

def _reason(self, reason: Optional[str] = None) -> str:
"""The default reason for cancelling or terminating a job"""
return reason if reason is not None else "manually initiated"
Expand Down

0 comments on commit cd8a2b4

Please sign in to comment.