-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
language: nodejs | ||
nodejs: | ||
- 0.10 | ||
- 0.12 | ||
- iojs-v1 | ||
- iojs-v2 | ||
- iojs-v3 | ||
- iojs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Cron-cluster | ||
Ensure that a cron is launched only for a node app when it was clustered | ||
|
||
## Install | ||
```bash | ||
npm install cron-cluster | ||
``` | ||
|
||
## Usage | ||
```js | ||
var redis = require('redis').createClient() | ||
var CronJob = require('cron-cluster')(redis).CronJob | ||
|
||
function doCron () { | ||
var job = new CronJob('* * * * * *', function () { | ||
// Do some stuff here | ||
}) | ||
job.start() | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
require('./lib/cron-cluster') | ||
module.exports = require('./lib/cron-cluster') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
{ | ||
"name": "cron-cluster", | ||
"version": "0.0.1", | ||
"description": "A Cluster plugin for cron using redis", | ||
"description": "A Cluster version of node-cron using redis", | ||
"main": "index.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"test": "tap test/*.js | faucet" | ||
"test": "standard {lib,test}/*.js && tape test/*.js | faucet", | ||
"watch-test": "onchange 'lib/*.js' 'test/*.js' -- npm test" | ||
}, | ||
"author": "Andy Vanbutsele <[email protected]>", | ||
"license": "ISC", | ||
|
@@ -17,7 +18,11 @@ | |
"redis-leader": "^0.1.0" | ||
}, | ||
"devDependencies": { | ||
"async": "^1.4.2", | ||
"faucet": "0.0.1", | ||
"tap": "^1.4.0" | ||
"onchange": "^2.0.0", | ||
"redis": "^1.0.0", | ||
"standard": "^5.2.1", | ||
"tape": "^4.2.0" | ||
} | ||
} |