Django APscheduler prevent more workers running scheduled task #592
Unanswered
MarkoKlima
asked this question in
Q&A
Replies: 3 comments 5 replies
-
Did you figure this out? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Have you read the FAQ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello @MarkoKlima , i have same issue . |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use APScheduler in Django, on Windows IIS (.NET CLR Version v4.0, AlwaysRunning, Maximum Worker Processes 5) to run my background script. Problem is, taks gets run multiple times. If I run same program on my PC, it only runs once, but when I upload to windows server (which hosts my Django app) it runs more times. I guess it has some connection with the number of workers? Job is scheduled, but each time job task is done, it's like it runs random number of instances. First 1 time, then 2, then 10, then again 2. Even tho I have 'replace_existing=True, coalesce= True, misfire_grace_time = 1, max_instances = 1'
planer_zad.py
apps.py
For test I tried 'interval':
Tried:
Does not work. Sometimes it runs only once, then 12 times. Also, I tried using two jobs, 1 to send email and write BOOL to database (signal that email has been sent), to block sending more then once. Then after 30min, I unblock that BOOL. It didn't work, it also sent 6 emails.
Beta Was this translation helpful? Give feedback.
All reactions