air on the side of killing server
This commit is contained in:
parent
ab717248fa
commit
35f447b643
3 changed files with 21 additions and 19 deletions
4
extension/package-lock.json
generated
4
extension/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "continue",
|
||||
"version": "0.0.147",
|
||||
"version": "0.0.149",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "continue",
|
||||
"version": "0.0.147",
|
||||
"version": "0.0.149",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
"displayName": "Continue",
|
||||
"pricing": "Free",
|
||||
"description": "The open-source coding autopilot",
|
||||
"version": "0.0.147",
|
||||
"version": "0.0.149",
|
||||
"publisher": "Continue",
|
||||
"engines": {
|
||||
"vscode": "^1.67.0"
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue