forked from PastVu/pastvu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotifier.js
executable file
·29 lines (21 loc) · 909 Bytes
/
notifier.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
import moment from 'moment';
import log4js from 'log4js';
import config from './config';
import connectDb from './controllers/connection';
import { ready as mailReady } from './controllers/mail';
import { ready as subscrReady } from './controllers/subscr';
import { ready as settingsReady } from './controllers/settings';
import './models/_initValues';
import './controllers/systemjs';
export async function configure(startStamp) {
const logger = log4js.getLogger('notifier');
logger.info('Application Hash: ' + config.hash);
await connectDb({
redis: config.redis,
mongo: { uri: config.mongo.connection, poolSize: config.mongo.pool },
logger,
});
moment.locale(config.lang); // Set global language for momentjs
await Promise.all([settingsReady, subscrReady, mailReady]);
logger.info(`Notifier started up in ${(Date.now() - startStamp) / 1000}s`);
}