summaryrefslogtreecommitdiff
path: root/extension/src/activation
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src/activation')
-rw-r--r--extension/src/activation/environmentSetup.ts34
1 files changed, 18 insertions, 16 deletions
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts
index 02118501..ff8d3158 100644
--- a/extension/src/activation/environmentSetup.ts
+++ b/extension/src/activation/environmentSetup.ts
@@ -366,24 +366,26 @@ export async function startContinuePythonServer() {
setupServerPath();
return await retryThenFail(async () => {
- if (await checkServerRunning(serverUrl)) {
- // Kill the server if it is running an old version
- if (fs.existsSync(serverVersionPath())) {
- const serverVersion = fs.readFileSync(serverVersionPath(), "utf8");
- if (serverVersion === getExtensionVersion()) {
- return;
- }
- }
- console.log("Killing old server...");
- try {
- await fkill(":65432");
- } catch (e) {
- console.log(
- "Failed to kill old server, likely because it didn't exist:",
- e
- );
+ // Kill the server if it is running an old version
+ if (fs.existsSync(serverVersionPath())) {
+ const serverVersion = fs.readFileSync(serverVersionPath(), "utf8");
+ if (
+ serverVersion === getExtensionVersion() &&
+ (await checkServerRunning(serverUrl))
+ ) {
+ // The current version is already up and running, no need to continue
+ return;
}
}
+ console.log("Killing old server...");
+ try {
+ await fkill(":65432");
+ } catch (e) {
+ console.log(
+ "Failed to kill old server, likely because it didn't exist:",
+ e
+ );
+ }
// Do this after above check so we don't have to waste time setting up the env
await setupPythonEnv();