Skip to content

Commit 27cdf83

Browse files
committed
v3.1.0 - Dominator now has a 10 second grace period before hitting the database, and automatically purges internal data + new configuration option (see description)
New configuration fields are autoRetry, autoPurge and gracePeriod. More information can be found in Documentation.md
1 parent 4fe7c76 commit 27cdf83

File tree

36 files changed

+80
-20
lines changed

36 files changed

+80
-20
lines changed

DOCUMENTATION.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ Steve Jobs is an all inclusive package for scheduling background jobs. It automa
2222

2323
```javascript
2424
Jobs.configure({
25-
autoStart: Boolean, // specify if the package should start automatically on Meteor.startup
26-
interval: Number, // specify how often the package should check for due jobs
27-
startupDelay: Number, // specify how long after server startup the package should start running
28-
maxWait: Number, // specify how long the server could be inactive before another server takes on the master role disableDevelopmentMode: Boolean, // development mode assumes that only one server is running, and that it is the active one
29-
setServerId: Function, // determine how to set the serverId - for example, you can have the package use your hosts deployment id
30-
getDate: Function, // determine how to get the current date, if for whatever reason, new Date() is not suitable
31-
log: Function, // determine how to log the package outputs
32-
remoteCollection: String, // store jobs data in a remote collection
25+
// Key // Default Description
26+
autoStart: Boolean, // true - specify if the package should start automatically on Meteor.startup
27+
autoRetry: Boolean, // true - specify if the package should retry failed jobs whenever a new server takes control
28+
autoPurge: Boolean, // true - specify if the package should automatically delete internal data (not job related)
29+
interval: Number, // 3000 - specify how often the package should check for due jobs
30+
startupDelay: Number, // 1000 - specify how long after server startup the package should start running
31+
maxWait: Number, // 5min. - specify how long the server could be inactive before another server takes on the master role disableDevelopmentMode: Boolean, // development mode assumes that only one server is running, and that it is the active one
32+
setServerId: Function, // Random.id () - determine how to set the serverId - for example, you can have the package use your hosts deployment id
33+
getDate: Function, // new Date() - determine how to get the current date, if for whatever reason, new Date() is not suitable
34+
log: Function, // console.log - determine how to log the package outputs
35+
remoteCollection: String, // undefined - store jobs data in a remote collection
3336
})
3437
```
3538

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Run scheduled tasks with Steve Jobs, the simple jobs queue made just for Meteor.
1212
- Failed jobs are retried on server restart
1313
- No third party dependencies
1414

15-
**The <a href="https://github.com/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/blob/master/CHANGES.md">new 3.0</a> features repeating jobs and more improvements.** It can run hundreds of jobs in seconds with minimal CPU impact, making it a reasonable choice for many applications. To get started, check out the <a href="https://github.com/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/blob/master/DOCUMENTATION.md">**documentation**</a> and the <a href="#quick-start">**quick start**</a> below.
15+
**The <a href="https://github.com/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/blob/master/CHANGES.md">new 3.1</a> features repeating jobs and more improvements.** It can run hundreds of jobs in seconds with minimal CPU impact, making it a reasonable choice for many applications. To get started, check out the <a href="https://github.com/msavin/SteveJobs..meteor.jobs.scheduler.queue.background.tasks/blob/master/DOCUMENTATION.md">**documentation**</a> and the <a href="#quick-start">**quick start**</a> below.
1616

1717
## Developer Friendly GUI and API
1818

package/package.js

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package.describe({
22
name: "msavin:sjobs",
33
summary: "The simple jobs queue that just works [synced, schedule, tasks, background, later, worker, cron]",
4-
version: "3.0.8",
4+
version: "3.1.0",
55
documentation: "README.md",
66
git: "https://github.com/msavin/SteveJobs.git",
77
});

package/server/README.md

100644100755
File mode changed.

package/server/api.js

100644100755
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@ var Jobs = {}
1010
Jobs.configure = function (config) {
1111
check(config, {
1212
autoStart: Match.Maybe(Boolean),
13+
autoPurge: Match.Maybe(Boolean),
14+
autoRetry: Match.Maybe(Boolean),
1315
interval: Match.Maybe(Number),
1416
startupDelay: Match.Maybe(Number),
1517
maxWait: Match.Maybe(Number),
1618
disableDevelopmentMode: Match.Maybe(Boolean),
1719
setServerId: Match.Maybe(Function),
1820
getDate: Match.Maybe(Function),
1921
log: Match.Maybe(Function),
20-
remoteCollection: Match.Maybe(String)
22+
remoteCollection: Match.Maybe(String),
23+
gracePeriod: Match.Maybe(Number),
2124
})
2225

2326
Object.keys(config).forEach(function (key) {

package/server/imports/actions/cancel/index.js

100644100755
File mode changed.

package/server/imports/actions/clear/index.js

100644100755
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import { Utilities } from "../../utilities"
22

33
var clear = function (state, name, callback) {
4-
action = {
4+
if (typeof state === "string" && state !== "*") {
5+
state = [state]
6+
}
7+
8+
var action = {
59
state: {
610
$in: state || ["cancelled", "success"]
711
}
812
}
913

10-
if (typeof name === "string") {
14+
if (name && typeof name === "string") {
1115
action.name = name
1216
}
1317

14-
if (typeof name === "object") {
18+
if (name && typeof name === "object") {
1519
action.name = {
1620
$in: name
1721
}

package/server/imports/actions/execute/index.js

100644100755
File mode changed.

package/server/imports/actions/execute/process.js

100644100755
File mode changed.

package/server/imports/actions/execute/toolbelt.js

100644100755
File mode changed.

0 commit comments

Comments
 (0)