Skip to content

Commit 9903e02

Browse files
committed
chore: minor bugfix
1 parent 45b5658 commit 9903e02

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

datajoint/autopopulate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,13 @@ def schedule_jobs(self, *restrictions, purge_invalid_jobs=True, min_scheduling_i
479479

480480
if min_scheduling_interval > 0:
481481
recent_scheduling_event = (
482-
self._Jobs
482+
self._Jobs.proj(last_scheduled="TIMESTAMPDIFF(SECOND, timestamp, UTC_TIMESTAMP())")
483483
& {"table_name": f"__{self.target.table_name}__"}
484484
& {"key_hash": key_hash(__scheduled_event)}
485-
& f"timestamp >= DATE_SUB(UTC_TIMESTAMP(), INTERVAL {min_scheduling_interval} SECOND)"
485+
& f"last_scheduled >= {min_scheduling_interval}"
486486
)
487487
if recent_scheduling_event:
488-
logger.debug(f"Skipping jobs scheduling for `{to_camel_case(self.target.table_name)}` (most recent scheduling event was within {min_scheduling_interval} seconds)")
488+
logger.debug(f"Skipping jobs scheduling for `{to_camel_case(self.target.table_name)}` (last scheduling event was {recent_scheduling_event.fetch1('last_scheduled')} seconds ago)")
489489
return
490490

491491
try:

0 commit comments

Comments
 (0)