Skip to content

Commit 774127c

Browse files
Fix startup timeout after adjusting sleeps (#5199)
1 parent 945745b commit 774127c

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/process.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ import { Settings, validateCwdSetting } from "./settings";
1111
import utils = require("./utils");
1212

1313
export class PowerShellProcess {
14-
// This is used to warn the user that the extension is taking longer than expected to startup.
15-
private static warnUserThreshold = 30;
16-
1714
private static title = "PowerShell Extension";
1815

1916
public onExited: vscode.Event<void>;
@@ -282,9 +279,9 @@ export class PowerShellProcess {
282279
private async waitForSessionFile(
283280
cancellationToken: vscode.CancellationToken,
284281
): Promise<IEditorServicesSessionDetails | undefined> {
285-
const numOfTries =
286-
this.sessionSettings.developer.waitForSessionFileTimeoutSeconds;
287-
const warnAt = numOfTries - PowerShellProcess.warnUserThreshold;
282+
const numOfTries = // We sleep for 1/5 of a second each try
283+
5 * this.sessionSettings.developer.waitForSessionFileTimeoutSeconds;
284+
const warnAt = numOfTries - 5 * 30; // Warn at 30 seconds
288285

289286
// Check every second.
290287
this.logger.writeDebug(
@@ -314,7 +311,7 @@ export class PowerShellProcess {
314311
);
315312
}
316313

317-
// Wait a bit and try again.
314+
// Wait 1/5 of a second and try again
318315
await utils.sleep(200);
319316
}
320317

0 commit comments

Comments
 (0)