Skip to content

Commit

Permalink
Tidying up
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Kudinkin <[email protected]>
  • Loading branch information
alexeykudinkin committed May 31, 2024
1 parent 0b2d5df commit 69d32d0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions dashboard/modules/job/job_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,14 +520,7 @@ async def _monitor_job_internal(self):
# In case job executor is running successfully, reachable and responsive, log
# running status of the job's driver every JOB_STATUS_LOG_FREQUENCY_SECONDS
# (to keep it as heart-beat check, but avoid logging it on every iteration)
if (
i
% int(
self.JOB_STATUS_LOG_INTERVAL_S
/ self.JOB_MONITOR_LOOP_INTERVAL_S
)
== 0
):
if self._should_report_running(i):
self._logger.info(
f"({self._job_id}) Job driver is still running (job status: {job_status}"
)
Expand Down Expand Up @@ -662,6 +655,11 @@ def _get_job_started_at(self, job_info: Optional[JobInfo]) -> float:
# start-up timestamp as job's one
return job_info.start_time / 1000 if job_info else self._started_at

def _should_report_running(self, iteration: int):
return (
iteration % int(self.JOB_STATUS_LOG_INTERVAL_S / self.JOB_MONITOR_LOOP_INTERVAL_S) == 0
)

@staticmethod
def _has_entrypoint_resources_set(job_info: JobInfo):
assert job_info
Expand Down

0 comments on commit 69d32d0

Please sign in to comment.