Skip to content

Commit

Permalink
chore: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Sep 4, 2020
1 parent 7eea19b commit 3083c0c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ export function createReloader() {
const active: [Reloadable, () => void][] = [];
return {
start(obj: Reloadable, onError?: (e: Error) => void, name?: string): Promise<void> {
log.info(`Adding ${name} as reloadable`);
const reconnectInfo = autoReconnect(() => obj.start(), onError, name);
active.push([obj, reconnectInfo[1]]);
return reconnectInfo[0]();
},
async stop() {
log.info('Stopping all reloadable tasks');
for(const item of active) {
item[1]();
await item[0].stop();
Expand Down

0 comments on commit 3083c0c

Please sign in to comment.