Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sweep GHA Fix] The GitHub Actions run failed with... #41

Open
wants to merge 2 commits into
base: sweep/sweep_gha_fix_the_github_actions_run_fai_19913
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ const getListeningAddresses = () => {

bootstrapServer(env).then(({ httpServer }) => {
httpServer.on('error', (err) => {
console.error('Server startup error:', err.message);
console.log('Server startup error:', err);
process.exitCode = 1;
process.exitCode = 1;
process.exitCode = 1;
process.exit(1);
process.exit(1);
console.error('Server startup error:', err);
process.exit(1);
});
httpServer.on('listening', () => {
console.log('Server is listening.');
console.log('Server started and is listening.');
});
const server = httpServer.listen(env.PORT, env.HOST, () => {
let versionString;
Expand Down Expand Up @@ -71,16 +69,16 @@ DM Section: ${addresses[0]}/dm`);

console.log(`\n-------------------\n`);
process.on('SIGINT', () => {
console.log("Shutting down");
httpServer.close((err) => {
if (err) {
console.error('Server shutdown error:', err);
process.exit(1);
} else {
console.log('Server successfully shut down.');
process.exit(0);
}
});
console.log("Shutting down gracefully");
httpServer.close((err) => {
if (err) {
console.error('Server shutdown error:', err);
process.exit(1);
} else {
console.log('Server successfully shut down.');
process.exit(0);
}
});
});

process.on("SIGINT", shutdownHandler);
Expand All @@ -90,7 +88,7 @@ DM Section: ${addresses[0]}/dm`);
server.on("connection", (connection) => { activeConnections.add(connection);
connections.add(connection);
connection.on("close", () => {
connections.delete(connection);
activeConnections.delete(connection);
});
});

Expand All @@ -102,7 +100,7 @@ DM Section: ${addresses[0]}/dm`);
console.error('Server shutdown error:', err);
process.exit(1);
} else {
console.log('Server successfully shut down.');
console.log('Server shut down gracefully.');
process.exit(0);
}
if (err) {
Expand All @@ -111,7 +109,7 @@ DM Section: ${addresses[0]}/dm`);
}
});

for (const connection of connections) {
for (const connection of activeConnections) {
connection.destroy();
}
});
Expand Down
Loading