Thanks for the video. But I have faced wired issue like- If i have multiple process running, then it calls multiple time the scheduler. Basically i was making logs for the scheduler functions then it was creating multiple time same log. So need to handle this thing, when using this scheduler approach.
Hi sir, this ready function is called twice in my case. So the job is executed twice. Can you suggest what may be the cause for this? (I guess there is an issue with the structure of the project) I’m new to django and I couldn’t find where the problem is getting initiated. I found that the app.py file is called twice by adding a pront statement inside it. Can you please help me in making the job scheduler run once?
Hi, I had this problem some time ago. It’s something todo with the workers. I always user a celery, beat and redis combo to handle tasks now. I’ve got a few videos on how to get it working. There is a short learning curve but it’s more robust.
Hi there. Thanks for your message. I have stopped using this package as Celery has far more feature and is widely used commercially. You should check it out
Hi there. Yes, this is a pain! This stack overflow thread explains why this happens and how to get around it (stackoverflow.com/questions/39253537/apscheduler-is-executing-job-multiple-times). Also, I have put another video together on how to use Celery to schedule jobs (ua-cam.com/video/_9MbgyUvDGs/v-deo.html)
I had the same issue, and I solved it using Ibraheem's solution in my development environment, but when I deploy the app in production (Ubuntu server) using gunicorn (3 workers) and Nginx, the task is executed 3 times (maybe because the 3 workers), I read that it can be solved using Job store or something else but I don't understand how to do that. Someone know how to fix the problem in production? Thank you!
Hi, I have a question please, is it possible to link the execution to a specific app. Example, my first app is a log in app, than an other app where the user choose a third app. I want that the job starts when the user choose the third app. Is it possible to do that ? In my case, it starts immediately after manage.py runserver, even if I define ready(self) in the third app. Thank you for your amazing work!
Hiya. I use APScheduler for basic routine function calls but it can handle more complex operations. I would suggest that you read the docs. Note: I will be putting a sequel together in the coming weeks that will be more comprehensive than this video.
got a question, hope its not sound too stupid.. what are the difference between using a job scheduler and celery cons and pros using each, or are they totally different thank you
Sorry for not seeing this comment!! The job scheduler is pretty light weight but is great for small projects. I would use Celery, Celery beat & Redis for large scale projects.
@@DidCoding Sorry it's was my fault. Due to some database flag columns, it does not update the table, when I wrote the comment. Later find out the issue was actually on my side, not the library itself. Btw, Thank you buddy for this helpful tutorial.
Hi, thanks for the video. When I deploy the app in production (Ubuntu server) using gunicorn (3 workers) and Nginx, the task is executed 3 times (maybe because the 3 workers), I read that it can be solved using Job store or something else but I don't understand how to do that. Someone know how to fix the problem in production? Thank you!
Hi Fernando. You are right. according to the documentation, a suggested workaround is to "run where the scheduler in a dedicated process and connect to it via some sort of remote access mechanism like RPyC, gRPC or an HTTP server." The link is: apscheduler.readthedocs.io/en/stable/faq.html#how-do-i-share-a-single-job-store-among-one-or-more-worker-processes
@@DidCoding Thank you! I gonna read more about this. For now I found a solution tha is working for me without many complications, I wrote about it in an answer in the surprit kumar comment, you can check it for your validation!
@@priyankav.chaudhari62 Here is the link: stackoverflow.com/questions/16053364/make-sure-only-one-worker-launches-the-apscheduler-event-in-a-pyramid-web-app-ru/40162246#40162246 The key is to use the flag --preload when you run gunicorn Also I configured this option for the scheduler as follows: job_defaults = { 'coalesce': True, 'max_instances': 1 } scheduler = BackgroundScheduler(job_defaults=job_defaults) I put the updater.start() in the wsgi.py
raise ValueError('The following arguments have not been supplied: %s' % ValueError: The following arguments have not been supplied: request this error is rising, in scheduler.add_job(scheduleT, 'interval' , seconds=5) May you help me please.
Just found this. it's awesome. been scratching my head since celery doesn't support windows. Thanks!
No worries. Glad the video was helpful
I cant thank you enough. I have been banging my head after many libraries but this one's miracle. 🙏
No worries 👍
your face zooming at me at 7:37 was low key terrifying, but good video
😂😂 brilliant!
I was experimenting with editing back when I put this one together.
Thanks for the feedback
Awesome video, I was looking for a simpler solution and this video was just spot on!
Thanks for the feedback 🙌
i like how you did your explanation you just explained your code)), i think its a fresh look from all the follow along tutorials i like it keep it up.
Haha. Yeah, my typing is rubbish so it’s best to just explain the code & logic 😀
great job,man you saved my project thanks a lot
Glad to have helped 🙌
great stuff. It truly made my evening!
👍
thanks good man!!!! at last found this method!
Thanks from Brazi!
No worries
Thanks for the video. But I have faced wired issue like- If i have multiple process running, then it calls multiple time the scheduler. Basically i was making logs for the scheduler functions then it was creating multiple time same log. So need to handle this thing, when using this scheduler approach.
Hi sir, this ready function is called twice in my case. So the job is executed twice. Can you suggest what may be the cause for this? (I guess there is an issue with the structure of the project) I’m new to django and I couldn’t find where the problem is getting initiated. I found that the app.py file is called twice by adding a pront statement inside it. Can you please help me in making the job scheduler run once?
Hi,
I had this problem some time ago. It’s something todo with the workers.
I always user a celery, beat and redis combo to handle tasks now. I’ve got a few videos on how to get it working. There is a short learning curve but it’s more robust.
can you go over how we can integrate long running scripts (over 30 seconds) without interfering with the django site itself?
Hi there. Thanks for your message. I have stopped using this package as Celery has far more feature and is widely used commercially. You should check it out
looks cool, i will try on my project instaed celery. Thanks
No worries.
Hello, thanks for this. My scheduler seems to be running twice each time the job is to be executed. what is the way out?
Hi there. Yes, this is a pain! This stack overflow thread explains why this happens and how to get around it (stackoverflow.com/questions/39253537/apscheduler-is-executing-job-multiple-times). Also, I have put another video together on how to use Celery to schedule jobs (ua-cam.com/video/_9MbgyUvDGs/v-deo.html)
@@DidCoding thank you
If I am adding schedular start in apps.py file . It is calling twice at a time
How strange! If you get your project on GitHub and send me a link I’ll have a quick look for you
I had the same issue, and I solved it using Ibraheem's solution in my development environment, but when I deploy the app in production (Ubuntu server) using gunicorn (3 workers) and Nginx, the task is executed 3 times (maybe because the 3 workers), I read that it can be solved using Job store or something else but I don't understand how to do that. Someone know how to fix the problem in production? Thank you!
It looks like my app needs some work. I’ll take a look and find a production fix.
thanks , thanks ,
it's easy to use , and work
Thanks for your comment
Hi, I have a question please, is it possible to link the execution to a specific app. Example, my first app is a log in app, than an other app where the user choose a third app. I want that the job starts when the user choose the third app. Is it possible to do that ? In my case, it starts immediately after manage.py runserver, even if I define ready(self) in the third app. Thank you for your amazing work!
Hiya. I use APScheduler for basic routine function calls but it can handle more complex operations. I would suggest that you read the docs.
Note: I will be putting a sequel together in the coming weeks that will be more comprehensive than this video.
Thaaaaaaaaannnnnnnkkkkkkkkkkkkkkk U!!!!!!!!!!!!!!!!!!!
🙌
got a question, hope its not sound too stupid.. what are the difference between using a job scheduler and celery cons and pros using each, or are they totally different thank you
Sorry for not seeing this comment!! The job scheduler is pretty light weight but is great for small projects. I would use Celery, Celery beat & Redis for large scale projects.
i have 10 job scheduled in that i want to remove 5th and 6th jobschedule how to do it using APS?
Sorry for the delay. Did you figure it out. I actually haven’t worked on APS for some time. I found celery & celery beat easier to use.
thanks,
do u know ansible-runner?@@DidCoding
Thanks a lot !
No worries
If Job function want a value than as parameter
It's work if we just print a message, but unable to update database table!
Oh really? That’s strange. Are you saving the new object?
@@DidCoding Sorry it's was my fault. Due to some database flag columns, it does not update the table, when I wrote the comment. Later find out the issue was actually on my side, not the library itself. Btw, Thank you buddy for this helpful tutorial.
@@sondhi31 No worries at all.
It mostly works for me, it is a pity that the scheduled job runs twice eacht time :/
Hi there. It’s because it runs with multiple workers. You should check out my celery video as this could be more suitable for your app.
thank you for this video
No worries. Thanks for the feedback
Hi, thanks for the video. When I deploy the app in production (Ubuntu server) using gunicorn (3 workers) and Nginx, the task is executed 3 times (maybe because the 3 workers), I read that it can be solved using Job store or something else but I don't understand how to do that. Someone know how to fix the problem in production? Thank you!
Hi Fernando. You are right. according to the documentation, a suggested workaround is to "run where the scheduler in a dedicated process and connect to it via some sort of remote access mechanism like RPyC, gRPC or an HTTP server." The link is: apscheduler.readthedocs.io/en/stable/faq.html#how-do-i-share-a-single-job-store-among-one-or-more-worker-processes
@@DidCoding Thank you! I gonna read more about this. For now I found a solution tha is working for me without many complications, I wrote about it in an answer in the surprit kumar comment, you can check it for your validation!
Thank you. I’ll be sure to have a look. I’ll put a sequel together with a robust workaround for production in the coming weeks👍
@@faberrocalv8958 can you please share the link where you commented on the solution.
@@priyankav.chaudhari62 Here is the link: stackoverflow.com/questions/16053364/make-sure-only-one-worker-launches-the-apscheduler-event-in-a-pyramid-web-app-ru/40162246#40162246
The key is to use the flag --preload when you run gunicorn
Also I configured this option for the scheduler as follows:
job_defaults = {
'coalesce': True,
'max_instances': 1
}
scheduler = BackgroundScheduler(job_defaults=job_defaults)
I put the updater.start() in the wsgi.py
super, thanks sir 👍
No worries 👍
I have done this to my django project, but not working :(
Does it not work at all or does it run multiple times as per some of the previous comments?
Thank you
🙌
Tried this but nothing is happening. I am using Windows.
Hi there. You will need to give me more detail on the issue you have for me to help.
Thanks
Bobby
This isn't a calendar like the thumbnail showed 🤦♂
Correct. The video demonstrates how to create a job scheduler in Django 👍
Un idolo
Thanks
👍
raise ValueError('The following arguments have not been supplied: %s' %
ValueError: The following arguments have not been supplied: request
this error is rising, in
scheduler.add_job(scheduleT, 'interval' , seconds=5)
May you help me please.
Hi, I’m on vacation at the moment. However, if you send an invite to your git repo to bobby@didcoding.com, I’ll take a look when I have a second
@@DidCoding send me your email id.... my git hub is currently not working