@@ -39,8 +39,6 @@ async function isContainerized(): Promise<boolean> {
39
39
}
40
40
41
41
export class Telemetry {
42
- /** Resolves when the device ID is retrieved or timeout occurs */
43
- private pendingPromises : number = 2 ;
44
42
private deviceIdPromise : Promise < string > | undefined ;
45
43
private containerEnvPromise : Promise < boolean > | undefined ;
46
44
private deviceIdAbortController = new AbortController ( ) ;
@@ -110,12 +108,8 @@ export class Telemetry {
110
108
}
111
109
} ,
112
110
abortSignal : this . deviceIdAbortController . signal ,
113
- } ) . finally ( ( ) => {
114
- this . pendingPromises -- ;
115
- } ) ;
116
- this . containerEnvPromise = this . getContainerEnv ( ) . finally ( ( ) => {
117
- this . pendingPromises -- ;
118
111
} ) ;
112
+ this . containerEnvPromise = this . getContainerEnv ( ) ;
119
113
}
120
114
121
115
public async close ( ) : Promise < void > {
@@ -174,20 +168,11 @@ export class Telemetry {
174
168
return ! doNotTrack ;
175
169
}
176
170
177
- private hasPendingPromises ( ) : boolean {
178
- return this . pendingPromises > 0 ;
179
- }
180
-
181
171
/**
182
172
* Attempts to emit events through authenticated and unauthenticated clients
183
173
* Falls back to caching if both attempts fail
184
174
*/
185
175
private async emit ( events : BaseEvent [ ] ) : Promise < void > {
186
- if ( this . hasPendingPromises ( ) ) {
187
- this . eventCache . appendEvents ( events ) ;
188
- return ;
189
- }
190
-
191
176
const cachedEvents = this . eventCache . getEvents ( ) ;
192
177
const allEvents = [ ...cachedEvents , ...events ] ;
193
178
0 commit comments