Skip to content

fix: make graceful shutdown idempotent - #28

Merged
isthatpratham merged 1 commit into
mainfrom
fix/idempotent-graceful-shutdown
Aug 30, 2026
Merged

fix: make graceful shutdown idempotent#28
isthatpratham merged 1 commit into
mainfrom
fix/idempotent-graceful-shutdown

Conversation

@isthatpratham

Copy link
Copy Markdown
Owner

Summary

  • First SIGINT/SIGTERM still stops cron, closes HTTP, then SQLite
  • Later signals are ignored so server.close is not invoked twice

Testing

  • npm test -- src/__tests__/shutdownGate.test.ts passed
  • npm run build succeeded

A second SIGINT or SIGTERM no longer calls server.close again, which can throw ERR_SERVER_NOT_RUNNING during shutdown.
@isthatpratham
isthatpratham merged commit 4cee9c3 into main Aug 30, 2026
1 check passed
@isthatpratham
isthatpratham deleted the fix/idempotent-graceful-shutdown branch August 30, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant