MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / flush

Function flush

packages/core/src/client.ts:442–458  ·  view source on GitHub ↗
(timeout?: number)

Source from the content-addressed store, hash-verified

440 */
441 // @ts-expect-error - PromiseLike is a subset of Promise
442 public async flush(timeout?: number): PromiseLike<boolean> {
443 const transport = this._transport;
444
445 // Emit `flush` unconditionally so weight-based log/metric flushers drain
446 // their buffers and clear their idle timers, even when no transport is
447 // configured (e.g. no DSN).
448 this.emit('flush');
449
450 if (!transport) {
451 return true;
452 }
453
454 const clientFinished = await this._isClientDoneProcessing(timeout);
455 const transportFlushed = await transport.flush(timeout);
456
457 return clientFinished && transportFlushed;
458 }
459
460 /**
461 * Flush the event queue and set the client to `enabled = false`. See {@link Client.flush}.

Callers 11

index.test.tsFile · 0.90
waitForPostMessageFunction · 0.90
flushSafelyWithTimeoutFunction · 0.90
flushSafelyWithTimeoutFunction · 0.90
cleanupOtelFunction · 0.90
flushAndDisposeFunction · 0.90
instrumentedCallbackMethod · 0.90
wrappedHandlerFunction · 0.90

Calls 2

emitMethod · 0.65
flushMethod · 0.65

Tested by 1

waitForPostMessageFunction · 0.72