I love watching small topic long videos coz i work in nontech fulltime so cant practice too much, doing this way feels like i am typing myself, i would go home and i start typing,everything just comes naturally 😊
Amazing. Thank you for you kind comments. I will indeed keep producing more content. Thank you for liking my content. Please share to others that may gain from this information as well :)
Liked and subscribed. Awesome stuff here man. Believe me you're one of those with the talent to teach. I'm gonna refer all my programming friends here anyday. Just keep putting out awesome content like this one.
Alright I will create something like that in the very near future, but to give you a spoiler, it involves using the .stop() method on the task that has been created, once the cron job runs the first time. there are several ways to achieve this.
I am very happy that this was helpful to you. nothing warms my heart more than seeing comments as these. Thanks a lot. To answer your question BullMQ jobs and NodeJS cron jobs, although appearing similar on the surface are quite different in functionality. For instance BullMQ jobs are built to work primarily with a redis database under the hood and cronjobs have nothing to do with redis. BullMQ jobs of course uses a queueing system, where jobs are placed on wait to be executed, but cronjobs pretty much can be set to run at multiple specific times down to the timezone of the required job. They both have their advantages and use cases of course. like BullMQ is primarily used with typescript as well as with a system built with microservice architecture. The BullMQ docs is pretty cool and exhaustive, I'd advice you to go through it and give it a whirl. Of course I will be working on a BullMQ video in the future. docs.bullmq.io/
That is a very good question. one way of doing that is to save a reference to the job in a database. So that if the server is down, whenever the server comes back up, it searches for that reference of any uncompleted jobs in the database and then executes the cron job or cron jobs again. feel free to ask me anything else you don't understand.
Thanks man for the awesome tutorial. Please can you make a video about the database jobs you just talked about, like what is the reasoning behind it. Does it have anything to do with queuing ???
@@dikimuhamadsyidik9650 There are a lot of ways to solve the problem of when the server goes down So basically in my mind how it works is. You save the reference to the cron jobs in the database, like say - a mongoose model called Cronjobs. Where the cronstring will be stored along with the name of function to be executed, and maybe the status of the cron (active: true or active:false). So that when the server is back up, It queries the data base for the documents of cron job collection and execute any active crons. There are other ways to handle things like this. You could also set a cron job as a Google cloud function or lambda. That will be set up the Google cloud server for execution only when the time for the cron job is reached. I'll release a video on the latter solution soon. I hope I've been able to clarify somethings Apologies for the delay🙂
@@enduranceochonogor6291 Yes I will make a video to clarify. There are several ways to handle the jobs problem for when the server is down I will make a video soon about this. Watch this space :)
I love watching small topic long videos coz i work in nontech fulltime so cant practice too much, doing this way feels like i am typing myself, i would go home and i start typing,everything just comes naturally 😊
Thanks a million, sir. Finally, I was able to set up a cron job for my database rows deletion on remote server :)
I’m happy to have helped you :)
I have more coming soon.
Thanks for your support
can I have a link to your git repository, working on something similar
Your explanation is awesome! you have Amazing Talent!!!
Learned a lot. Thanks! I really hope you keep producing more content
Amazing. Thank you for you kind comments. I will indeed keep producing more content. Thank you for liking my content. Please share to others that may gain from this information as well :)
Liked and subscribed. Awesome stuff here man.
Believe me you're one of those with the talent to teach. I'm gonna refer all my programming friends here anyday.
Just keep putting out awesome content like this one.
OMG thanks so much for this.
I really appreciate your kind words!!
I'll keep on trying to put out similar content.
Loads more where this came from :)
Best tutorial ❤
Great video you walked through everything thank you :)
Glad it was helpful!
It will nice if you increase the font size of editor.
Thank you so much for your efforts.
how to stop task conditionally without running an additional task for checking?
I have a time column in database... I want to run cronjob at that time once a user adds a new time in db... How to do that??
Awesome stuff man love it
awesome tutorial, thank you!
A suggestion for next videos: increase the font size for easier readability.
i'm from India Thanks...❤
Thank you. wow
Thank you so much, sir. clearly explained
Awesome video sir, Learned a lot.
I am having dupication from node-cron. What to do?
thnks bro
Please add vedio of CRON job with stopping the tasks once it reached end date
Alright I will create something like that in the very near future, but to give you a spoiler, it involves using the .stop() method on the task that has been created, once the cron job runs the first time.
there are several ways to achieve this.
Can you talk about Unit Testing a cron job or is this all Integration testing?
Great video ! I learned a lot of helpful stuff for my own projects. How are Cron jobs different from BullMQ jobs?
I am very happy that this was helpful to you. nothing warms my heart more than seeing comments as these. Thanks a lot.
To answer your question BullMQ jobs and NodeJS cron jobs, although appearing similar on the surface are quite different in functionality.
For instance BullMQ jobs are built to work primarily with a redis database under the hood and cronjobs have nothing to do with redis.
BullMQ jobs of course uses a queueing system, where jobs are placed on wait to be executed, but cronjobs pretty much can be set to run at multiple specific times down to the timezone of the required job.
They both have their advantages and use cases of course. like BullMQ is primarily used with typescript as well as with a system built with microservice architecture.
The BullMQ docs is pretty cool and exhaustive, I'd advice you to go through it and give it a whirl. Of course I will be working on a BullMQ video in the future.
docs.bullmq.io/
[ASK] how to handle the scheduled cron if the server goes down but we want to keep the job is still define ? thanks you
That is a very good question.
one way of doing that is to save a reference to the job in a database.
So that if the server is down, whenever the server comes back up, it searches for that reference of any uncompleted jobs in the database and then executes the cron job or cron jobs again.
feel free to ask me anything else you don't understand.
@@degraphe8824 so we save the cron job schedule to the database and use the cron from job is that true ? or we use the database for log ?
Thanks man for the awesome tutorial.
Please can you make a video about the database jobs you just talked about, like what is the reasoning behind it.
Does it have anything to do with queuing ???
@@dikimuhamadsyidik9650
There are a lot of ways to solve the problem of when the server goes down
So basically in my mind how it works is.
You save the reference to the cron jobs in the database, like say - a mongoose model called Cronjobs. Where the cronstring will be stored along with the name of function to be executed, and maybe the status of the cron (active: true or active:false).
So that when the server is back up,
It queries the data base for the documents of cron job collection and execute any active crons.
There are other ways to handle things like this.
You could also set a cron job as a Google cloud function or lambda. That will be set up the Google cloud server for execution only when the time for the cron job is reached.
I'll release a video on the latter solution soon.
I hope I've been able to clarify somethings
Apologies for the delay🙂
@@enduranceochonogor6291
Yes I will make a video to clarify.
There are several ways to handle the jobs problem for when the server is down
I will make a video soon about this.
Watch this space :)