Skip to content

Commit

Permalink
fix some minor shutdown issues
Browse files Browse the repository at this point in the history
  • Loading branch information
meadowsys committed Nov 13, 2023
1 parent 7436459 commit 5306bcb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
21 changes: 14 additions & 7 deletions lib/Application.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,24 @@ class Application {
});
}

/**
* @returns { Promise<void> }
*/
static stopModules() {
return new Promise((resolve, reject) => {
this.log.info("Stopping Modules");

Promise.all(this.moduleObjs.map(m => m.instance.stop()))
.then(() => {
this.moduleObjs = null;
this.modules = null;
resolve();
})
.catch(reject);
if (this.moduleObjs) {
Promise.all(this.moduleObjs.map(m => m.instance.stop()))
.then(() => {
this.moduleObjs = null;
this.modules = null;
resolve();
})
.catch(reject);
} else {
resolve();
}
});
}

Expand Down
3 changes: 0 additions & 3 deletions modules/TimeToGalacon/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ module.exports = class CanniTimeToHype extends Module {
if (active) {
Application.modules.Discord.client.on("ready", () => {
this.setGalaconDate();
setInterval(() => {
this.updateGalaconDate();
}, (this.config.updateInterval || 10) * 1000);
});
}

Expand Down

0 comments on commit 5306bcb

Please sign in to comment.