Vercel Functions 现已支持优雅退出

来源: Vercel News

原文

Vercel Functions running on Node.js and Python runtimes now support graceful shutdown, giving you up to 500 milliseconds to run cleanup tasks before termination.

When a function is terminated, such as during scale-down, the runtime receives a SIGTERM signal. You can now use this signal to run cleanup tasks like closing database connections or flushing external logs.

Learn more about the SIGTERM signal.

Read more