Мелкий рефакторинг

This commit is contained in:
Book Pauk
2022-11-27 21:28:48 +07:00
parent d859202fb1
commit abcbbc86bc
2 changed files with 5 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ const DbSearcher = require('./DbSearcher');
const InpxHashCreator = require('./InpxHashCreator');
const RemoteLib = require('./RemoteLib');//singleton
const ayncExit = new (require('./AsyncExit'))();
const asyncExit = new (require('./AsyncExit'))();
const log = new (require('./AppLogger'))().log;//singleton
const utils = require('./utils');
const genreTree = require('./genres');
@@ -53,7 +53,7 @@ class WebWorker {
this.db = null;
this.dbSearcher = null;
ayncExit.add(this.closeDb.bind(this));
asyncExit.add(this.closeDb.bind(this));
this.loadOrCreateDb();//no await
this.periodicLogServerStats();//no await
@@ -221,7 +221,7 @@ class WebWorker {
this.logServerStats();
} catch (e) {
log(LM_FATAL, e.message);
ayncExit.exit(1);
asyncExit.exit(1);
}
}
@@ -628,7 +628,7 @@ class WebWorker {
}
} catch (e) {
log(LM_FATAL, e.message);
ayncExit.exit(1);
asyncExit.exit(1);
}
}

View File

@@ -158,8 +158,7 @@ async function main() {
opds(app, config);
initStatic(app, config);
const WebAccess = require('./core/WebAccess');
const webAccess = new WebAccess(config);
const webAccess = new (require('./core/WebAccess'))(config);
await webAccess.init();
const { WebSocketController } = require('./controllers');