Skip to content

Commit 8a4bc0b

Browse files
committed
delay importing of telemetry package further
1 parent 1c0dbe8 commit 8a4bc0b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

extension/src/config.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ export class Config {
4949
this.executionDetailsChanged = this.dispose.track(new EventEmitter())
5050
this.onDidChangeExecutionDetails = this.executionDetailsChanged.event
5151

52-
this.setPythonBinPath()
53-
54-
this.onDidChangePythonExecutionDetails()
52+
this.setPythonBinPath().then(() => {
53+
this.onDidChangePythonExecutionDetails()
54+
this.onDidConfigurationChange()
55+
})
5556

5657
this.vsCodeTheme = window.activeColorTheme
5758

@@ -60,8 +61,6 @@ export class Config {
6061
this.vsCodeTheme = window.activeColorTheme
6162
})
6263
)
63-
64-
this.onDidConfigurationChange()
6564
}
6665

6766
public setDvcRoots(dvcRoots: string[]): void {

extension/src/extension.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {
4545
} from './telemetry'
4646
import { EventName } from './telemetry/constants'
4747
import { RegisteredCommands } from './commands/external'
48-
import { StopWatch } from './util/time'
48+
import { delay, StopWatch } from './util/time'
4949

5050
export { Disposable, Disposer }
5151

@@ -254,7 +254,7 @@ export class Extension implements IExtension {
254254
)
255255
)
256256

257-
this.dispose.track(getTelemetryReporter())
257+
delay(500).then(() => this.dispose.track(getTelemetryReporter()))
258258
}
259259

260260
public hasRoots = () => definedAndNonEmpty(this.dvcRoots)

extension/src/fileSystem/tree.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,10 @@ export class TrackedExplorerTree implements TreeDataProvider<string> {
110110
}
111111

112112
private async getRootElements() {
113+
const rootElements = await Promise.all(
114+
this.dvcRoots.map(dvcRoot => this.readDirectory(dvcRoot, dvcRoot))
115+
)
116+
113117
if (!this.viewed) {
114118
sendViewOpenedTelemetryEvent(
115119
EventName.VIEWS_TRACKED_EXPLORER_TREE_OPENED,
@@ -118,9 +122,6 @@ export class TrackedExplorerTree implements TreeDataProvider<string> {
118122
this.viewed = true
119123
}
120124

121-
const rootElements = await Promise.all(
122-
this.dvcRoots.map(dvcRoot => this.readDirectory(dvcRoot, dvcRoot))
123-
)
124125
return rootElements
125126
.reduce((a, b) => a.concat(b), [])
126127
.sort((a, b) => {

0 commit comments

Comments
 (0)