-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
30 lines (26 loc) · 794 Bytes
/
app.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
28
29
30
var _ = require("lodash"),
util = require("util"),
Sequelize = require("sequelize"),
Chainer = Sequelize.Utils.QueryChainer,
models = require("./models");
callider = require("./callider")
// Dirty hack
new Chainer()
.add(models.db, 'sync', [{force: true}] )
.add(models.callider_db, 'sync')
.runSerially()
.success( function () {
callider.syncUsers(models.callider_db, models.db).then(function () {
util.log("Users done");
}, function (error) {
util.log("Can't get users");
})
.then(function () {
callider.syncSchedule(models.callider_db, models.db).success(function () {
util.log("We got data synced");
})
}, function (error) {
console.log("Something bad occurs");
util.log(util.inspect(error));
})
})