NODE JS CRON JOBS (ALL YOU NEED TO KNOW)

  Рет қаралды 17,925

Degraphe

Degraphe

Күн бұрын

In this video, I will be talking about every single thing you need to know about cron jobs in Node JS.
If there is anything I missed, pleased feel free to leave that at the comment below.
I hope you enjoy the video
#nodejs #javascript #cronjob

Пікірлер: 35
@prgrmr-yn
@prgrmr-yn Жыл бұрын
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 😊
@prasanthmanimaran5158
@prasanthmanimaran5158 2 жыл бұрын
Thanks a million, sir. Finally, I was able to set up a cron job for my database rows deletion on remote server :)
@degraphe8824
@degraphe8824 2 жыл бұрын
I’m happy to have helped you :) I have more coming soon. Thanks for your support
@rahimshash1631
@rahimshash1631 8 ай бұрын
can I have a link to your git repository, working on something similar
@bhagavathchoudhary4519
@bhagavathchoudhary4519 Жыл бұрын
Your explanation is awesome! you have Amazing Talent!!!
@Finn-jp6pn
@Finn-jp6pn 2 жыл бұрын
Learned a lot. Thanks! I really hope you keep producing more content
@degraphe8824
@degraphe8824 2 жыл бұрын
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 :)
@enduranceochonogor6291
@enduranceochonogor6291 2 жыл бұрын
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.
@degraphe8824
@degraphe8824 2 жыл бұрын
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 :)
@LightDarkBlue
@LightDarkBlue 4 ай бұрын
Great video you walked through everything thank you :)
@degraphe8824
@degraphe8824 4 ай бұрын
Glad it was helpful!
@MrSeredan
@MrSeredan Жыл бұрын
Best tutorial ❤
@sukanyaa1110
@sukanyaa1110 2 жыл бұрын
Thank you so much, sir. clearly explained
@musicworld9868
@musicworld9868 2 жыл бұрын
Awesome video sir, Learned a lot.
@abessesmahi4888
@abessesmahi4888 2 жыл бұрын
It will nice if you increase the font size of editor. Thank you so much for your efforts.
@ufyohwo3613
@ufyohwo3613 6 ай бұрын
awesome tutorial, thank you!
@GabrielArghire
@GabrielArghire 2 жыл бұрын
A suggestion for next videos: increase the font size for easier readability.
@prgrmr-yn
@prgrmr-yn Жыл бұрын
Awesome stuff man love it
@NaveenKumar-ue6oc
@NaveenKumar-ue6oc 2 жыл бұрын
i'm from India Thanks...❤
@alii4334
@alii4334 Жыл бұрын
how to stop task conditionally without running an additional task for checking?
@riturajjha
@riturajjha 2 жыл бұрын
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??
@rufansdev7446
@rufansdev7446 2 жыл бұрын
Thank you. wow
@fadhilrahman8346
@fadhilrahman8346 10 ай бұрын
thnks bro
@sourabhvaishnav8235
@sourabhvaishnav8235 Жыл бұрын
I am having dupication from node-cron. What to do?
@ranjithanarayan8852
@ranjithanarayan8852 3 жыл бұрын
Please add vedio of CRON job with stopping the tasks once it reached end date
@degraphe8824
@degraphe8824 2 жыл бұрын
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.
@dikimuhamadsyidik9650
@dikimuhamadsyidik9650 2 жыл бұрын
[ASK] how to handle the scheduled cron if the server goes down but we want to keep the job is still define ? thanks you
@degraphe8824
@degraphe8824 2 жыл бұрын
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.
@dikimuhamadsyidik9650
@dikimuhamadsyidik9650 2 жыл бұрын
@@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 ?
@enduranceochonogor6291
@enduranceochonogor6291 2 жыл бұрын
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 ???
@degraphe8824
@degraphe8824 2 жыл бұрын
@@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🙂
@degraphe8824
@degraphe8824 2 жыл бұрын
@@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 :)
@qcmira2024
@qcmira2024 2 жыл бұрын
Great video ! I learned a lot of helpful stuff for my own projects. How are Cron jobs different from BullMQ jobs?
@degraphe8824
@degraphe8824 2 жыл бұрын
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/
@dk11soccer
@dk11soccer 2 жыл бұрын
Can you talk about Unit Testing a cron job or is this all Integration testing?
Scheduling Tasks in Node.js | Cron Jobs in Real Projects
22:19
Dipesh Malvia
Рет қаралды 2,4 М.
Node.js is a serious thing now… (2023)
8:18
Code With Ryan
Рет қаралды 646 М.
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 17 МЛН
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 57 МЛН
МЕБЕЛЬ ВЫДАСТ СОТРУДНИКАМ ПОЛИЦИИ ТАБЕЛЬНУЮ МЕБЕЛЬ
00:20
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 37 МЛН
Unit Testing with JEST in 80 Minutes - CRASH COURSE (NODE JS)
1:17:33
as const: the most underrated TypeScript feature
5:38
Matt Pocock
Рет қаралды 118 М.
Scaling your Node.js app using the "cluster" module
13:44
Software Developer Diaries
Рет қаралды 42 М.
How to scale NodeJs applications using the cluster module.
13:37
Mafia Codes
Рет қаралды 50 М.
Crontab in Linux - How to Schedule a Cron Job using Ubuntu
11:07
Redis with Node Crash Course - Cache Data for Improved Performance
44:58
How To Manage User Roles In Node.js
22:45
Web Dev Simplified
Рет қаралды 308 М.
What are Message Queues? | BullMQ Queues NodeJS
44:12
Piyush Garg
Рет қаралды 33 М.
Bull & NestJS = Achieving Scale in Node.js
31:41
Michael Guay
Рет қаралды 31 М.
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Wian
Рет қаралды 17 МЛН