-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
Description
See https://vercel.com/changelog/vercel-functions-now-support-graceful-shutdown, Vercel has added a new way to handle graceful shutdown. We should use it to flush events in Sentry effectively:
process.on('SIGTERM', () => {
Sentry.flush();
});
Things to figure out:
- Where should we call this? I guess this is not Next.js specific. So I would propose to add this in both Node as well as vercel-edge SDKs guarded by an env-var check for
process.env.VERCEL
? - We should test that this actually works (in both edge and node)
- We should remove eventually remaining code to handle this in a more hacky way, using waitUntil or similar for vercel