cron-cluster | Cron cluster is designed to prevent a job which must be | Cron Utils library
kandi X-RAY | cron-cluster Summary
kandi X-RAY | cron-cluster Summary
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.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cron-cluster
cron-cluster Key Features
cron-cluster Examples and Code Snippets
Community Discussions
Trending Discussions on cron-cluster
QUESTION
I am trying to create a clustered Cronjob using
cron-cluster
and redis
on Node.js. We are running multiple servers with different roles (production, staging, test) and the same codebase. They are all connected to the same Redis instance.
How do I make cron-cluster
run only once on each role?
Currently, it picks only one server across the whole fleet (production, staging, test) and runs everything there.
ANSWER
Answered 2020-Mar-30 at 17:39I had the same issue with cron-cluster library. To solve it, you should pass a unique key, while initializing an instance. For example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cron-cluster
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page