@@ -39,8 +39,6 @@ async function isContainerized(): Promise<boolean> {
3939}
4040
4141export class Telemetry {
42- /** Resolves when the device ID is retrieved or timeout occurs */
43- private pendingPromises : number = 2 ;
4442 private deviceIdPromise : Promise < string > | undefined ;
4543 private containerEnvPromise : Promise < boolean > | undefined ;
4644 private deviceIdAbortController = new AbortController ( ) ;
@@ -110,12 +108,8 @@ export class Telemetry {
110108 }
111109 } ,
112110 abortSignal : this . deviceIdAbortController . signal ,
113- } ) . finally ( ( ) => {
114- this . pendingPromises -- ;
115- } ) ;
116- this . containerEnvPromise = this . getContainerEnv ( ) . finally ( ( ) => {
117- this . pendingPromises -- ;
118111 } ) ;
112+ this . containerEnvPromise = this . getContainerEnv ( ) ;
119113 }
120114
121115 public async close ( ) : Promise < void > {
@@ -174,20 +168,11 @@ export class Telemetry {
174168 return ! doNotTrack ;
175169 }
176170
177- private hasPendingPromises ( ) : boolean {
178- return this . pendingPromises > 0 ;
179- }
180-
181171 /**
182172 * Attempts to emit events through authenticated and unauthenticated clients
183173 * Falls back to caching if both attempts fail
184174 */
185175 private async emit ( events : BaseEvent [ ] ) : Promise < void > {
186- if ( this . hasPendingPromises ( ) ) {
187- this . eventCache . appendEvents ( events ) ;
188- return ;
189- }
190-
191176 const cachedEvents = this . eventCache . getEvents ( ) ;
192177 const allEvents = [ ...cachedEvents , ...events ] ;
193178
0 commit comments