MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / close

Method close

packages/node-core/src/sdk/client.ts:104–123  ·  view source on GitHub ↗
(timeout?: number | undefined)

Source from the content-addressed store, hash-verified

102 /** @inheritDoc */
103 // @ts-expect-error - PromiseLike is a subset of Promise
104 public async close(timeout?: number | undefined): PromiseLike<boolean> {
105 if (this._clientReportInterval) {
106 clearInterval(this._clientReportInterval);
107 }
108
109 if (this._clientReportOnExitFlushListener) {
110 process.off('beforeExit', this._clientReportOnExitFlushListener);
111 }
112
113 if (this._logOnExitFlushListener) {
114 process.off('beforeExit', this._logOnExitFlushListener);
115 }
116
117 const allEventsSent = await super.close(timeout);
118 if (this.traceProvider) {
119 await this.traceProvider.shutdown();
120 }
121
122 return allEventsSent;
123 }
124
125 /**
126 * Will start tracking client reports for this client.

Callers

nothing calls this directly

Calls 3

offMethod · 0.65
closeMethod · 0.65
shutdownMethod · 0.65

Tested by

no test coverage detected