forked from PastVu/pastvu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
notifier.js
executable file
·33 lines (24 loc) · 1022 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
30
31
32
33
/**
* Copyright: The PastVu contributors.
* GNU Affero General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/agpl.txt)
*/
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';
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`);
}