New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fastify-graceful-shutdown

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-graceful-shutdown - npm Package Compare versions

Comparing version 3.5.2 to 3.5.3

18

index.js

@@ -10,3 +10,5 @@ 'use strict'

function fastifyGracefulShutdown(fastify, opts, next) {
const logger = fastify.log.child({ plugin: 'fastify-graceful-shutdown' })
const logger = fastify.log
? fastify.log.child({ plugin: 'fastify-graceful-shutdown' })
: undefined
const handlers = []

@@ -39,10 +41,10 @@ const timeout = opts.timeout || 10000

if (err) {
logger.error({ err: err, signal: signal }, 'process terminated')
logger.error?.({ err: err, signal: signal }, 'process terminated')
// Avoid losing data
logger.flush()
logger.flush?.()
handlerEventListener.exit(1)
} else {
logger.debug({ signal: signal }, 'process terminated')
logger.debug?.({ signal: signal }, 'process terminated')
// Avoid losing data
logger.flush()
logger.flush?.()
handlerEventListener.exit(0)

@@ -54,3 +56,3 @@ }

setTimeout(() => {
logger.error(
logger.error?.(
{ signal: signal, timeout: timeout },

@@ -78,3 +80,3 @@ 'terminate process after timeout',

addHandler((signal, cb) => {
logger.debug({ signal: signal }, 'triggering close hook')
logger.debug?.({ signal: signal }, 'triggering close hook')
fastify.close(cb)

@@ -87,3 +89,3 @@ })

terminateAfterTimeout(signal, timeout)
logger.debug({ signal: signal }, 'received signal')
logger.debug?.({ signal: signal }, 'received signal')
shutdown(signal)

@@ -90,0 +92,0 @@ }

{
"name": "fastify-graceful-shutdown",
"version": "3.5.2",
"version": "3.5.3",
"description": "Gracefully shutdown fastify",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc