We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
waitUntil
1 parent 4f05f12 commit c2a12ddCopy full SHA for c2a12dd
packages/astro/src/server/middleware.ts
@@ -14,8 +14,10 @@ import {
14
import type { Scope, SpanAttributes } from '@sentry/types';
15
import {
16
addNonEnumerableProperty,
17
+ flushSafelyWithTimeout,
18
objectify,
19
stripUrlQueryAndFragment,
20
+ vercelWaitUntil,
21
winterCGRequestToRequestData,
22
} from '@sentry/utils';
23
import type { APIContext, MiddlewareResponseHandler } from 'astro';
@@ -188,6 +190,8 @@ async function instrumentRequest(
188
190
} catch (e) {
189
191
sendErrorToSentry(e);
192
throw e;
193
+ } finally {
194
+ vercelWaitUntil(flushSafelyWithTimeout());
195
}
196
// TODO: flush if serverless (first extract function)
197
},
0 commit comments