interfaces/shutdown-hooks-options.interface.ts

nest · packages/common/interfaces/shutdown-hooks-options.interface.ts · typescript · MIT
infra

Interface defining options for configuring application shutdown hooks, including process exit behavior.

// Source: https://github.com/nestjs/nest | License: MIT | Copyright 2017-present Kamil Mysliwiec <https://kamilmysliwiec.com>
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Options for configuring shutdown hooks behavior.
 *
 * @publicApi
 */
export interface ShutdownHooksOptions {
  /**
   * If true, uses `process.exit()` instead of `process.kill(process.pid, signal)`
   * after shutdown hooks complete. This ensures the 'exit' event is properly
   * triggered, which is required for async loggers (like Pino with transports)
   * to flush their buffers before the process terminates.
   *
   * Note: Using `process.exit()` will:
   * - Change the exit code (e.g., SIGTERM: 143 → 0)
   * - May not trigger other signal handlers from third-party libraries
   * - May affe

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key