From a87c5facb04582af3e6609239e327b67baadfcc7 Mon Sep 17 00:00:00 2001 From: wyang Date: Tue, 9 Jul 2024 18:49:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rq/job.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rq/job.py b/rq/job.py index e1c77ec..3a8b32c 100644 --- a/rq/job.py +++ b/rq/job.py @@ -335,6 +335,8 @@ class Job: status (JobStatus): The Job Status to be set pipeline (Optional[Pipeline], optional): Optional Redis Pipeline to use. Defaults to None. """ + if status == JobStatus.SCHEDULED: + logger.info("set scheduled:" + self.id, stack_info=True, stacklevel=5) self._status = status connection: 'Redis' = pipeline if pipeline is not None else self.connection connection.hset(self.key, 'status', self._status) @@ -1508,6 +1510,7 @@ class Job: self.retries_left = self.retries_left - 1 if retry_interval: scheduled_datetime = datetime.now(timezone.utc) + timedelta(seconds=retry_interval) + logger.info("schedule:" + self.id, stack_info=True, stacklevel=5) self.set_status(JobStatus.SCHEDULED) queue.schedule_job(self, scheduled_datetime, pipeline=pipeline) else: