Skip to content

Do not stop the server in onModuleDestroy hook #3597

Open
@sergVedmak

Description

@sergVedmak

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

We're need keeping the GraphQL server running after a SIGTERM is received. This behavior can be implemented using beforeApplicationShutdown hook, handling SIGTERM

But before calling beforeApplicationShutdown, onModuleDestroy is triggered and the server is closed, which in my opinion is not implemented correctly lifecycle sequence - stop http listeners should be after beforeApplicationShutdown

Describe the solution you'd like

Move stop sever in onApplicationShutdown hook

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

Keeping the GraphQL server running after a SIGTERM is received

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions