Gathering detailed insights and metrics for cron-cluster
Gathering detailed insights and metrics for cron-cluster
Gathering detailed insights and metrics for cron-cluster
Gathering detailed insights and metrics for cron-cluster
pm2
Production process manager for Node.JS applications with a built-in load balancer.
hapi-cron-cluster
A Hapi plugin to setup cron jobs that will call predefined server routes at specified times with leader election (cluster mode)
pmx
PM2/Keymetrics advanced API
redlock-cron
A cluster version of node-cron using redlock-leader.
npm install cron-cluster
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
40 Stars
21 Commits
11 Forks
4 Watchers
1 Branches
5 Contributors
Updated on Jun 14, 2024
Latest Version
1.1.3
Package Id
cron-cluster@1.1.3
Unpacked Size
19.71 kB
Size
3.19 kB
File Count
8
NPM Version
6.4.1
Node Version
10.11.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Cron cluster is designed to prevent a job which must be launched only once to be launched many times while an app is scaling accross a cluster with the same task scripts.
Cron cluster is based on node-cron and redis-leader to prevent a cron job to be launched if his process has not been elected as leader on redis.
Redis
1npm install cron-cluster
Cron cluster use the same API as the original CronJob.
1var redis = require('redis').createClient() 2var CronJob = require('cron-cluster')(redis).CronJob 3 4function doCron () { 5 var job = new CronJob('* * * * * *', function () { 6 // Do some stuff here 7 }) 8 job.start() 9}
It is possible to initialize CronJob with an object passed as parameter and run the job only once for all the instances. Cron-cluster is compatible with original cron. More in test/cron-cluster-compatibility-check.js
1var redis = require('redis').createClient() 2var CronJob = require('cron-cluster')(redis).CronJob 3 4function doCron () { 5 var job = new CronJob({ 6 cronTime: '* * * * * *', 7 onTick: function () { 8 // Do some stuff here 9 } 10 }) 11 job.start() 12}
All you need is to provide a redis client to the cron-cluster module.
Usage with Kue:
1var kue = require('kue'), 2 queue = kue.createQueue() 3var redis = require('redis').createClient() 4var CronJob = require('cron-cluster')(redis).CronJob 5 6new CronJob('* * * * * *', function () { 7 queue.create('log', { 8 text: 'this is a log' 9 }).save() 10}, null, true) 11 12queue.process('log', function (job, done) { 13 console.log(job.data.text) 14 done() 15})
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 2/19 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
48 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More