diff --git a/arq/worker.py b/arq/worker.py index 4c33b67..4bba4d6 100644 --- a/arq/worker.py +++ b/arq/worker.py @@ -751,7 +751,12 @@ async def run_cron(self, n: datetime, delay: float, num_windows: int = 2) -> Non job_id = f'{cron_job.name}:{to_unix_ms(cron_job.next_run)}' if cron_job.unique else None job_futures.add( self.pool.enqueue_job( - cron_job.name, _job_id=job_id, _queue_name=self.queue_name, _defer_until=cron_job.next_run + cron_job.name, + _job_id=job_id, + _queue_name=self.queue_name, + _defer_until=( + cron_job.next_run if cron_job.next_run > datetime.now(tz=self.timezone) else None + ), ) ) cron_job.calculate_next(cron_job.next_run)