Skip to content

Commit a6a9223

Browse files
committed
git job status added
1 parent 3802f60 commit a6a9223

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

app/main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,23 @@
8787
)
8888
runtime_identifier = template_job.runtime_identifier
8989

90+
def get_job_status( job_id: str) -> str:
91+
"""
92+
Get the status of a job run
93+
94+
Args:
95+
job_id (str): The ID of the job to check
96+
97+
Returns:
98+
str: The status of the most recent job run
99+
"""
100+
response = client_cml.list_job_runs(
101+
project_id,
102+
job_id,
103+
sort="-created_at",
104+
page_size=1
105+
)
106+
return response.job_runs[0].status
90107

91108
def get_total_size(file_paths):
92109

app/services/synthesis_job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def generate_job(self, request: Any, cpu: int = 2, memory: int = 4) -> Dict[str,
140140
'input_path': synthesis_service.safe_json_dumps(getattr(request, 'input_path', None)),
141141
'job_name': job_name,
142142
'job_id': job_run.job_id,
143-
'job_status': get_job_status(job_run.job_id),
143+
'job_status': self.get_job_status(job_run.job_id),
144144
'input_key': request.input_key,
145145
'output_key': request.output_key,
146146
'output_value': request.output_value,

0 commit comments

Comments
 (0)