Skip to content

Commit d651fdb

Browse files
committed
Add support for custom collection name
1 parent 7709ab9 commit d651fdb

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

package/package.js

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: "4.2.0",
4+
version: "4.3.1",
55
documentation: "README.md",
66
git: "https://github.com/msavin/SteveJobs.git",
77
});

package/server/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Jobs.configure = function (config) {
2121
log: Match.Maybe(Function),
2222
remoteCollection: Match.Maybe(String),
2323
gracePeriod: Match.Maybe(Number),
24+
collectionName: Match.Maybe(String)
2425
})
2526

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

package/server/imports/utilities/collection/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
import { Mongo } from "meteor/mongo"
22
import { config } from "../config"
33

4-
const collectionName = "jobs_data"
5-
64
const initializeCollection = function () {
7-
let collection;
8-
95
if (config.remoteCollection) {
106
const dbDriver = new MongoInternals.RemoteCollectionDriver(config.remoteCollection);
11-
collection = new Mongo.Collection(collectionName, { _driver: dbDriver });
7+
collection = new Mongo.Collection(config.collectionName, { _driver: dbDriver });
128
} else {
13-
collection = new Mongo.Collection(collectionName);
9+
collection = new Mongo.Collection(config.collectionName);
1410
}
1511

1612

package/server/imports/utilities/config/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ const config = {
1010
disableDevelopmentMode: false,
1111
remoteCollection: undefined,
1212
serverId: undefined,
13-
gracePeriod: 10
13+
gracePeriod: 10,
14+
collectionName: "jobs_data"
1415
}
1516

1617
config.getDate = function () {

0 commit comments

Comments
 (0)