Skip to content

Commit

Permalink
feat: Updated server/index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Jan 15, 2024
1 parent a18b7fb commit bedb4ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ bootstrapServer(env).then(({ httpServer }) => {
httpServer.on('error', (err) => {
console.error('Server startup error:', err);
process.exitCode = 1;
process.exitCode = 1;
process.exit(1);
console.error('Server startup error:', err);
process.exit(1);
Expand Down Expand Up @@ -68,7 +69,7 @@ Player Section: ${addresses[0]}
DM Section: ${addresses[0]}/dm`);

console.log(`\n-------------------\n`);
const shutdownHandler = once(() => {
process.on('SIGINT', () => {
console.log("Shutting down");
httpServer.close((err) => {
if (err) {
Expand All @@ -84,8 +85,8 @@ DM Section: ${addresses[0]}/dm`);
process.on("SIGINT", shutdownHandler);
});

const connections = new Set<Socket>();
server.on("connection", (connection) => {
const activeConnections = new Set<Socket>();
server.on("connection", (connection) => { activeConnections.add(connection);
connections.add(connection);
connection.on("close", () => {
connections.delete(connection);
Expand Down

0 comments on commit bedb4ba

Please sign in to comment.