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

Method dispose

packages/cloudflare/src/client.ts:124–140  ·  view source on GitHub ↗

* Disposes of the client and releases all resources. * * This method clears all Cloudflare-specific state in addition to the base client cleanup. * It unsubscribes from span lifecycle events and clears pending span tracking. * * Call this method after flushing to allow the client to b

()

Source from the content-addressed store, hash-verified

122 * After calling dispose(), the client should not be used anymore.
123 */
124 public override dispose(): void {
125 DEBUG_BUILD && debug.log('[CloudflareClient] Disposing client...');
126
127 super.dispose();
128
129 if (this._unsubscribeSpanStart) {
130 this._unsubscribeSpanStart();
131 this._unsubscribeSpanStart = null;
132 }
133 if (this._unsubscribeSpanEnd) {
134 this._unsubscribeSpanEnd();
135 this._unsubscribeSpanEnd = null;
136 }
137
138 this._resetSpanCompletionPromise();
139 (this as unknown as { _flushLock: ReturnType<typeof makeFlushLock> | void })._flushLock = undefined;
140 }
141
142 /**
143 * Resets the span completion promise and resolve function.

Callers 2

client.test.tsFile · 0.45
flushAndDisposeFunction · 0.45

Calls 2

logMethod · 0.65

Tested by

no test coverage detected