Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions packages/nextjs/src/common/utils/responseEnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ export function finishSpan(span: Span, res: ServerResponse): void {
export async function flushSafelyWithTimeout(): Promise<void> {
try {
DEBUG_BUILD && logger.log('Flushing events...');
// We give things that are currently stuck in event processors a tiny bit more time to finish before flushing. 50ms was chosen very unscientifically.
await new Promise(resolve => setTimeout(resolve, 50));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead call process.nextTick()? I guess that's not isomorphic though.

await flush(2000);
DEBUG_BUILD && logger.log('Done flushing events');
} catch (e) {
Expand Down