node-schedule
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -13,3 +13,4 @@ | ||
CronDate = require('cron-parser/lib/date'), | ||
lt = require('long-timeout'); | ||
lt = require('long-timeout'), | ||
sorted = require('sorted-array-functions'); | ||
@@ -64,7 +65,3 @@ /* Job object */ | ||
// add to our invocation list | ||
pendingInvocations.push(invocation); | ||
// and sort | ||
pendingInvocations.sort(sorter); | ||
sorted.add(pendingInvocations, invocation, sorter); | ||
return true; | ||
@@ -447,4 +444,3 @@ }; | ||
function scheduleInvocation(invocation) { | ||
invocations.push(invocation); | ||
invocations.sort(sorter); | ||
sorted.add(invocations, invocation, sorter); | ||
prepareNextInvocation(); | ||
@@ -451,0 +447,0 @@ invocation.job.emit('scheduled', invocation.fireDate); |
{ | ||
"name": "node-schedule", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A cron-like and not-cron-like job scheduler for Node.", | ||
@@ -28,3 +28,4 @@ "keywords": [ | ||
"cron-parser": "1.1.0", | ||
"long-timeout": "0.0.2" | ||
"long-timeout": "0.1.1", | ||
"sorted-array-functions": "^1.0.0" | ||
}, | ||
@@ -34,6 +35,6 @@ "devDependencies": { | ||
"eslint": "^0.15.1", | ||
"istanbul": "^0.3.8", | ||
"nodeunit": "^0.9.1", | ||
"istanbul": "^0.4.5", | ||
"nodeunit": "^0.10.2", | ||
"sinon": "^1.14.1" | ||
} | ||
} |
@@ -10,7 +10,2 @@ # Node Schedule | ||
>__Announcement:__ Node Schedule is looking for add additional collaborators | ||
with commit access. If you are actively involved in open source, | ||
ping [Tejas Manohar] via [email](mailto:me@tejas.io) to express interest. | ||
Those who already contribute to the project are preferred. | ||
Node Schedule is a flexible cron-like and not-cron-like job scheduler for Node.js. | ||
@@ -85,2 +80,4 @@ It allows you to schedule jobs (arbitrary functions) for execution at | ||
Execute a cron job when the minute is 42 (e.g. 19:42, 20:42, etc.). | ||
And: | ||
@@ -169,6 +166,16 @@ | ||
#### RecurrenceRule properties | ||
- `second` | ||
- `minute` | ||
- `hour` | ||
- `date` | ||
- `month` | ||
- `year` | ||
- `dayOfWeek` | ||
> **Note**: It's worth noting that the default value of a component of a recurrence rule is | ||
`null` (except for seconds, which is 0 for familiarity with cron). *If we did not | ||
explicitly set `minute` to 0 above, the message would have instead been logged at | ||
5:00pm, 5:01pm, 5:02pm, ..., 5:59pm.* Probably not what you want. | ||
> `null` (except for second, which is 0 for familiarity with cron). *If we did not | ||
> explicitly set `minute` to 0 above, the message would have instead been logged at | ||
> 5:00pm, 5:01pm, 5:02pm, ..., 5:59pm.* Probably not what you want. | ||
@@ -193,3 +200,3 @@ #### Object Literal Syntax | ||
let startTime = new Date(Date.now() + 5000); | ||
let endTime = new Date(now.getTime() + 5000); | ||
let endTime = new Date(startTime.getTime() + 5000); | ||
var j = schedule.scheduleJob({ start: startTime, end: endTime, rule: '*/1 * * * * *' }, function(){ | ||
@@ -196,0 +203,0 @@ console.log('Time for tea!'); |
229
74823
3
15
2136
+ Addedlong-timeout@0.1.1(transitive)
+ Addedsorted-array-functions@1.3.0(transitive)
- Removedlong-timeout@0.0.2(transitive)
Updatedlong-timeout@0.1.1