-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.js
39 lines (35 loc) · 1.07 KB
/
init.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
31
32
33
34
35
36
37
38
39
var async = require('async');
var init = {};
var userRankService = require('./tleModuleServices/userRankService');
var problemRankService = require('./tleModuleServices/problemRankService');
var recentSubmissionService = require('./tleModuleServices/recentSubmissionService');
init.initializeRedis = function (callback) {
async.parallel([
function (callback) {
userRankService.init(function (err) {
if (err) {
console.error("error populating user rank redis: " + err);
}
callback(err);
});
}, function (callback) {
problemRankService.init(function (err) {
if (err) {
console.error("error populating problem rank redis: " + err);
}
callback(err);
});
}, function (callback) {
recentSubmissionService.init(function (err) {
if (err) {
console.error("error populating recent submission redis: " + err);
}
callback(err);
});
}
], function (err) {
console.log("done populating cache");
callback(err);
});
};
module.exports = init;