Questions tagged [node-cron]

The node-cron module is tiny task scheduler in pure JavaScript for node.js based on GNU crontab. This module allows you to schedule task in node.js using full crontab syntax.

198 questions
1
vote
0 answers

Cron-job not maintaining intervals

please have a look at the following code: var cron = require('node-cron'); const { main } = require("./main/depositTxn.js") cron.schedule('* */5 * * * *', async () => { await main("0xdd160613122C9b3ceb2a2709123e3020CaDa2546"); }); I guess I…
1
vote
0 answers

How to schedule cron job to run only once at a specific date (with year) using node-cron?

I'm new to cron and actually not sure if node-cron is the right npm package for me. Basically, I just want to create a scheduled post feature in my app. Where I can set a time to post my content in the future. So I discovered node-cron and was able…
quielfala
  • 361
  • 4
  • 18
1
vote
2 answers

How can I execute multiple cron jobs at different timings using node-cron in nodejs?

How can I execute this with different timings? Please help on this. Thanks in Advance... const Cron = require('node-cron'); const Cron2 = require('node-cron'); var TaskOne = Cron.schedule('*/10 * * * *', async() => { //first job…
Lalit Kolate
  • 31
  • 1
  • 4
1
vote
0 answers

Telegram bot doesn't send message to one of my groups

I've built a telegram bot using Node.js to send a text message on specific times. So, I have 2 groups: one for testing and other to actually run it. It runs perfectly on testing group but it doesn't respond when it is supposed to run on my actual…
1
vote
3 answers

Ensure That Node Cron Job is Only Configured Once

I'm writing a Discord bot and having it schedule a cron job when it starts up using node-cron. I've defined it as follows (very basic so far): cron.schedule('15 1,3,5,7,9,11,13,15,17,19,21,23 * * *', () => { …
muttley91
  • 12,278
  • 33
  • 106
  • 160
1
vote
1 answer

Cron jobs do not run in Heroku

I am developing a Nodejs server which I am uploading to Heroku. The file has a Cron job which is meant to run every 4th hour. But when I check in nothing happens. I am using the free version of Heroku and I do not appear to be exceeding my limit of…
1
vote
0 answers

Node-Cron Does Not Working On Heroku (Push Scheduled Notification)- Node Cron Not Execute On Heroku Server

I am trying to send a scheduled notification with the node-cron library and it is working fine in my local system but after deploying the codes to the Heroku server it is not working. const triggerPushNotification = (notifiction, startMinutes,…
key joshua
  • 11
  • 2
1
vote
0 answers

Agenda jobs go to locked state and never run

I'm using Agenda for job processing. I'm facing an issue with the locking mechanism. I don't know how it works. If I define a job that is going to run at 12 AM then at 12 AM lockedAt updated with the current time and the job does not run. I'm using…
1
vote
1 answer

How to start schedule at reboot only on node-cron?

I would start my schedule whenever my server starts, On cronjob I use @reboot to schedule it, but seems this feature doesn't work on node-cron. cron.schedule('@reboot', () => { console.log('will execute at reboot'); });
Khai Dao
  • 55
  • 7
1
vote
1 answer

Cron is running 2 times node-cron

I installed node-cron library and configured 2 crons in the same file to run at different intervals. The first cron runs every 45 seconds and the second cron runs every 60 seconds, it works perfectly. The problem happens when the 60-second cron is…
Vinicius Aquino
  • 697
  • 13
  • 27
1
vote
2 answers

When a cron job is executed and there is already a cron running, are they running simultaneously?

my question may seem a little strange but I will try to explain, I have a cron job that executes a function, inside this function there is a loop that executes other functions, this cron is called every 1 minute, so far so good . The problem is that…
Vinicius Aquino
  • 697
  • 13
  • 27
1
vote
2 answers

Stop Cron Job inside the scheduler Node.js

I've created a cron-job to run a task and I want it to stop at some specific condition inside the scheduler, but it is not working. How can I stop cron job inside the scheduler? Here is my code: // cron-job.js const cron =…
Abhishek Pankar
  • 723
  • 8
  • 26
1
vote
0 answers

Mongoose: How to 'schedule' the update of access token (in our database), using refresh token?

Flow: User attempts to login via Spotify (OAuth), and grants access to our web app (nodejs). accessToken, refreshToken, expires_in and profile data is returned in exchange for the Authorization Code. (using Passport.js) accessToken, refreshToken…
Varun
  • 73
  • 1
  • 10
1
vote
2 answers

Node Cron not execute on heroku server

I have an application backend with express node deployed on heroku server. My backend application has a scheduling using node-cron. I set a schedule to send notifications with FCM every 7 a.m., but at 7 a.m. no notifications came in and I checked…
Jovanka
  • 211
  • 1
  • 4
  • 10
1
vote
1 answer

How to write HTML and CSS code in Node js to Send Eamils to Users

I want to send Emails using node-cron and wanted to style the message. Basically, I wanted to send user a list of things as attached below. I wanted to write something like this …
Centre Name