Skip to content

Fix minor clean up of sigint #61

@cdcabrera

Description

@cdcabrera

As a maintainer I need to review and potentially perform some minor clean up how we handle server shutdown of the server instance. Technically it's a non-issue, but the potential for multiple handlers is there.

In server.ts

let sigintHandler: (() => void) | null = null;
...
const stopServer = async () => {
...
      if (sigintHandler) {
        process.off('SIGINT', sigintHandler);
        sigintHandler = null;
      }
...

    if (enableSigint && !sigintHandler) {
      sigintHandler = () => {
        void stopServer();
      };
     process.on('SIGINT', sigintHandler);

Acceptance criteria

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions