fix API import errors when missing files

This commit is contained in:
Erik 2021-06-09 03:19:22 +03:00
parent 1e23fa5bc8
commit 23d6ed8212
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

@ -41,8 +41,9 @@ class Manager extends EventEmitter {
await this.shardManager.spawn(); await this.shardManager.spawn();
// G:\Documents\My programs\GBot\New GBot\api\index.cjs // G:\Documents\My programs\GBot\New GBot\api\index.cjs
this.info('Shards done, booting up API...'); this.info('Shards done, booting up API...');
const { default: APIManager } = await import('./api/index.js').catch((err) => this.error(`Import of API Manager failed.\n${err.stack}`)); const API = await import('./api/index.js').catch((err) => this.error(`Import of API Manager failed.\n${err.stack}`));
if (APIManager) { if (API) {
const { default: APIManager } = API;
this.apiManager = new APIManager(this); this.apiManager = new APIManager(this);
await this.apiManager.init(); await this.apiManager.init();
this.info('API done. Manager built.'); this.info('API done. Manager built.');
@ -91,6 +92,7 @@ class Manager extends EventEmitter {
const { type } = message; const { type } = message;
switch (type) { switch (type) {
case 'statsQuery': case 'statsQuery':
break;
// TODO: Figure out best strategy for stats querying - push/pull, prometheus, simple polling // TODO: Figure out best strategy for stats querying - push/pull, prometheus, simple polling
//return this.aggregateStatistics(); //return this.aggregateStatistics();
} }