Skip to content

main.ts missing enableShutdownHooks — Prisma never disconnects gracefully #16

Description

@presidojay1

PrismaService implements OnModuleDestroy to call $disconnect(), but Nest only invokes module-destroy lifecycle hooks on SIGTERM/SIGINT if app.enableShutdownHooks() was called during bootstrap. Without it, the process exits without draining Postgres connections cleanly on container restarts/deploys.

Suggested fix: Add app.enableShutdownHooks(); in bootstrap(), before app.listen(...).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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