Мелкий рефакторинг
This commit is contained in:
@@ -11,7 +11,7 @@ const DbSearcher = require('./DbSearcher');
|
|||||||
const InpxHashCreator = require('./InpxHashCreator');
|
const InpxHashCreator = require('./InpxHashCreator');
|
||||||
const RemoteLib = require('./RemoteLib');//singleton
|
const RemoteLib = require('./RemoteLib');//singleton
|
||||||
|
|
||||||
const ayncExit = new (require('./AsyncExit'))();
|
const asyncExit = new (require('./AsyncExit'))();
|
||||||
const log = new (require('./AppLogger'))().log;//singleton
|
const log = new (require('./AppLogger'))().log;//singleton
|
||||||
const utils = require('./utils');
|
const utils = require('./utils');
|
||||||
const genreTree = require('./genres');
|
const genreTree = require('./genres');
|
||||||
@@ -53,7 +53,7 @@ class WebWorker {
|
|||||||
this.db = null;
|
this.db = null;
|
||||||
this.dbSearcher = null;
|
this.dbSearcher = null;
|
||||||
|
|
||||||
ayncExit.add(this.closeDb.bind(this));
|
asyncExit.add(this.closeDb.bind(this));
|
||||||
|
|
||||||
this.loadOrCreateDb();//no await
|
this.loadOrCreateDb();//no await
|
||||||
this.periodicLogServerStats();//no await
|
this.periodicLogServerStats();//no await
|
||||||
@@ -221,7 +221,7 @@ class WebWorker {
|
|||||||
this.logServerStats();
|
this.logServerStats();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(LM_FATAL, e.message);
|
log(LM_FATAL, e.message);
|
||||||
ayncExit.exit(1);
|
asyncExit.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -628,7 +628,7 @@ class WebWorker {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log(LM_FATAL, e.message);
|
log(LM_FATAL, e.message);
|
||||||
ayncExit.exit(1);
|
asyncExit.exit(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -158,8 +158,7 @@ async function main() {
|
|||||||
opds(app, config);
|
opds(app, config);
|
||||||
initStatic(app, config);
|
initStatic(app, config);
|
||||||
|
|
||||||
const WebAccess = require('./core/WebAccess');
|
const webAccess = new (require('./core/WebAccess'))(config);
|
||||||
const webAccess = new WebAccess(config);
|
|
||||||
await webAccess.init();
|
await webAccess.init();
|
||||||
|
|
||||||
const { WebSocketController } = require('./controllers');
|
const { WebSocketController } = require('./controllers');
|
||||||
|
|||||||
Reference in New Issue
Block a user