Skip to content

Commit

Permalink
Handle the case when a job is not scheduled
Browse files Browse the repository at this point in the history
  • Loading branch information
BoPeng committed Jan 31, 2025
1 parent 59ac4f4 commit ee3e4a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ai_marketplace_monitor/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,6 @@ def convert_to_seconds(time_str: str) -> int:


def time_until_next_run() -> int:
next_run = min(job.next_run for job in schedule.jobs)
next_run = min(job.next_run for job in schedule.jobs if job.next_run is not None)
now = time.time()
return max(next_run.timestamp() - now, 0)
return max(int(next_run.timestamp() - now), 0)

0 comments on commit ee3e4a0

Please sign in to comment.