forked from bitwit/strider-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebapp.js
27 lines (26 loc) · 875 Bytes
/
webapp.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var scheduler = require('./lib/scheduler');
module.exports = {
// mongoose schema, if you need project-specific config
config: {
"scheduler": {
frequency: {type: Number, default: 0},
lastJob: {type: Date},
day: {type: String},
time: {type: Date},
daySelection: {type: Array}
}
},
routes: function (app, ctx) {
scheduler.init(ctx);
},
listen: function (emitter, context) {
emitter.on('branch.plugin_config', function (project, branch, plugin, config) {
if (plugin === 'scheduler') {
scheduler.branchChange(project, branch, config);
}
});
emitter.on('branch.plugin_order', function (project, branch, plugins) {
scheduler.branchPluginOrderChange(project, branch, plugins);
});
}
};