File tree Expand file tree Collapse file tree 2 files changed +17
-12
lines changed
Expand file tree Collapse file tree 2 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -313,13 +313,17 @@ def run(
313313 )
314314
315315 if not merged_intervals :
316- next_ready_interval_start = get_next_model_interval_start ( self . snapshots . values ())
316+ next_run_ready_msg = ""
317317
318- utc_time = format_tz_datetime (next_ready_interval_start )
319- local_time = format_tz_datetime (next_ready_interval_start , use_local_timezone = True )
318+ next_ready_interval_start = get_next_model_interval_start (self .snapshots .values ())
319+ if next_ready_interval_start :
320+ utc_time = format_tz_datetime (next_ready_interval_start )
321+ local_time = format_tz_datetime (next_ready_interval_start , use_local_timezone = True )
322+ time_msg = local_time if local_time == utc_time else f"{ local_time } ({ utc_time } )"
323+ next_run_ready_msg = f"\n \n Next run will be ready at { time_msg } ."
320324
321325 self .console .log_status_update (
322- f"No models are ready to run. Please wait until a model `cron` interval has elapsed.\n \n Next run will be ready at { local_time } ( { utc_time } ). "
326+ f"No models are ready to run. Please wait until a model `cron` interval has elapsed.{ next_run_ready_msg } "
323327 )
324328 return CompletionStatus .NOTHING_TO_DO
325329
Original file line number Diff line number Diff line change @@ -2087,12 +2087,13 @@ def _check_ready_intervals(
20872087 return checked_intervals
20882088
20892089
2090- def get_next_model_interval_start (snapshots : t .Iterable [Snapshot ]) -> datetime :
2090+ def get_next_model_interval_start (snapshots : t .Iterable [Snapshot ]) -> t . Optional [ datetime ] :
20912091 now_dt = now ()
2092- return min (
2093- [
2094- snap .node .cron_next (now_dt )
2095- for snap in snapshots
2096- if snap .is_model and not snap .is_symbolic and not snap .is_seed
2097- ]
2098- )
2092+
2093+ starts = [
2094+ snap .node .cron_next (now_dt )
2095+ for snap in snapshots
2096+ if snap .is_model and not snap .is_symbolic and not snap .is_seed
2097+ ]
2098+
2099+ return min (starts ) if starts else None
You can’t perform that action at this time.
0 commit comments