-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathmain.js
28 lines (21 loc) · 800 Bytes
/
main.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
const Configuration = require('./Configuration');
const Logger = require('./Logger');
const PlejdAddon = require('./PlejdAddon');
async function main() {
try {
// eslint-disable-next-line no-console
console.log('Starting Plejd addon and reading configuration...');
const addonInfo = Configuration.getAddonInfo();
const logger = Logger.getLogger('plejd-main');
logger.info(`Plejd add-on, version ${addonInfo.version}`);
logger.verbose(`Addon info: ${JSON.stringify(addonInfo)}`);
const addon = new PlejdAddon();
await addon.init();
logger.info('main() finished');
} catch (err) {
// eslint-disable-next-line no-console
console.log('Catastrophic error. Resetting entire addon in 1 minute', err);
setTimeout(() => main(), 60000);
}
}
main();