Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Add error message to http server close
Browse files Browse the repository at this point in the history
Closes #50
  • Loading branch information
GoldingAustin committed Dec 2, 2022
1 parent c2dc83d commit 16de009
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions applications/server/src/machines/server.machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ const serverMachine = createMachine(
let anonymizedPath = path.join(getDbPath(ctx.config.databaseMode), 'anonymized-campaigns');
if (existsSync(anonymizedPath)) rmSync(anonymizedPath, { recursive: true });
ctx.messagingService?.stop?.();
ctx.server.close(() => {
console.info('HTTP server closed');
ctx.server.close((err) => {
if (err) console.error('HTTP server closed', err);
else console.info('HTTP server closed');
process.exit();
});
} catch {
console.info('HTTP server closed');
} catch (err) {
console.error('HTTP server closed', err);
process.exit();
}
},
Expand Down

0 comments on commit 16de009

Please sign in to comment.