-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.js
More file actions
53 lines (47 loc) · 725 Bytes
/
app.js
File metadata and controls
53 lines (47 loc) · 725 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* node modules
*/
var async = require('async');
var CronJob = require('cron').CronJob;
/*
* loaded models
*/
var models = require('./models');
var controllers = require('./controllers');
/*
* setting cron jobs
*/
var job1 = new CronJob({
cronTime: '*/30 * * * * *',
onTick: function() {
controllers.buy(function(err) {
if (err) {
console.log(err);
process.exit();
}
});
return;
},
start: true,
timeZone: "Asia/Taipei"
});
var job2 = new CronJob({
cronTime: '*/10 * * * * *',
onTick: function() {
console.log(10);
return;
},
start: false,
timeZone: "Asia/Taipei"
});
/*
* start function
*/
var start = function() {
job1.start();
// job2.start();
};
/*
* start
*/
start();