Replies: 6 comments
-
It happens only with cron scheduled task that is called every minute. Maybe the source of problem is that "scheduler gathers tasks every minute" as mentioned in delayed_send function ? No.. Got it with minutes: "*/2" too [2024-02-21 13:40:59,625][INFO ][run:run_scheduler:208] Startup completed. duplicated [2024-02-21 13:52:00,002][INFO ][run:delayed_send:130] Sending task billing:sync-payments. |
Beta Was this translation helpful? Give feedback.
-
Trying to debug. Putting I get following delays on duplicated entries Delay: 0:00:00.000373 Delay: 0:00:59.997624 |
Beta Was this translation helpful? Give feedback.
-
One more example Next minute: 2024-02-22 14:13:00 Next minute: 2024-02-22 14:14:00 |
Beta Was this translation helpful? Give feedback.
-
in run_scheduler_loop function in next_minute calculation if datetime.now() = 17:22:59.55555 and we replace seconds and microseconds with 0 and add timedelta(minutes=1) we get next_minute=17:23:00 Don't you think that we should check delay like:
|
Beta Was this translation helpful? Give feedback.
-
Have same problem, did you find a solution yet? @sector119 btw: I turned off the reload mode in FastAPI, I was suspecting whether we could do something similar to issues in Flask to detect the reload process of the scheduler or worker:
|
Beta Was this translation helpful? Give feedback.
-
This problem should have been solved in #319. |
Beta Was this translation helpful? Give feedback.
-
Hello,
My task scheduled once. CreatedSchedule(id=7fc23130208e4086b685ce6bedaaeed1, time=None, cron=*/1 * * * *, cron_offset=Europe/Kyiv, task_name=billing:sync-payments, args=[], kwargs={'schema': 'aaa', 'external_source': 'bbb', 'rpc_source': 'ccc'})
redis has only one key "schedule:7fc23130208e4086b685ce6bedaaeed1"
But Task sending twice (
[2024-02-21 11:27:51,467][INFO ][run:run_scheduler:208] Startup completed.
first run - ok
[2024-02-21 11:27:51,502][INFO ][run:delayed_send:130] Sending task billing:sync-payments.
run 2 - ok
[2024-02-21 11:28:00,001][INFO ][run:delayed_send:130] Sending task billing:sync-payments.
send twice
[2024-02-21 11:29:00,001][INFO ][run:delayed_send:130] Sending task billing:sync-payments.
[2024-02-21 11:29:00,002][INFO ][run:delayed_send:130] Sending task billing:sync-payments.
send twice
[2024-02-21 11:30:00,000][INFO ][run:delayed_send:130] Sending task billing:sync-payments.
[2024-02-21 11:30:00,002][INFO ][run:delayed_send:130] Sending task billing:sync-payments.
and so on
Beta Was this translation helpful? Give feedback.
All reactions