django-q2 icon indicating copy to clipboard operation
django-q2 copied to clipboard

The problem with Scheduled

Open ZzzYanSong opened this issue 1 year ago • 2 comments

Hello, there seems to be a problem with the Scheduled tasks of django-q2. The time update of next_run seems to be just adding the interval time to the cached time, which makes the time displayed by next_run inaccurate.

For example

Image

My qcluster was shut down at 10:05 on February 13, 2025, and next_run was set to 10:10 on February 13, 2025. However, when I restarted qcluster at 12:40 on February 13, 2025, my scheduled task started to execute, but next_run was updated to 10:15 on February 13, 2025, while it should be 12:45 on February 13, 2025.

Thank you and wish you good luck in your work

ZzzYanSong avatar Feb 13 '25 04:02 ZzzYanSong

Hello @ZzzYanSong This is the desired behavior as django-q2 executes all the missed timings that should have been executed. If you don't want this, you can disable it in the settings with "catch_up":False. Here is the documentation: https://django-q2.readthedocs.io/en/master/configure.html#catch-up

Grayknife avatar Feb 13 '25 08:02 Grayknife

你好@ZzzYanSong 这是所需的行为,因为 django-q2 会执行所有应该执行的错过的计时。如果您不想要这个,您可以在设置中使用 禁用它"catch_up":False。以下是文档: https: //django-q2.readthedocs.io/en/master/configure.html#catch-up

Ok,I See.Thanks.

ZzzYanSong avatar Feb 13 '25 08:02 ZzzYanSong