aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/installation/server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/installation/server.ts')
-rw-r--r--editors/code/src/installation/server.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/editors/code/src/installation/server.ts b/editors/code/src/installation/server.ts
index 345f30d47..f35958474 100644
--- a/editors/code/src/installation/server.ts
+++ b/editors/code/src/installation/server.ts
@@ -5,7 +5,7 @@ import { spawnSync } from "child_process";
5import { ArtifactSource } from "./interfaces"; 5import { ArtifactSource } from "./interfaces";
6import { fetchArtifactReleaseInfo } from "./fetch_artifact_release_info"; 6import { fetchArtifactReleaseInfo } from "./fetch_artifact_release_info";
7import { downloadArtifactWithProgressUi } from "./downloads"; 7import { downloadArtifactWithProgressUi } from "./downloads";
8import { log, assert } from "../util"; 8import { log, assert, notReentrant } from "../util";
9import { Config, NIGHTLY_TAG } from "../config"; 9import { Config, NIGHTLY_TAG } from "../config";
10 10
11export async function ensureServerBinary(config: Config): Promise<null | string> { 11export async function ensureServerBinary(config: Config): Promise<null | string> {
@@ -82,7 +82,10 @@ function shouldDownloadServer(
82 return installed.date.getTime() !== required.date.getTime(); 82 return installed.date.getTime() !== required.date.getTime();
83} 83}
84 84
85async function downloadServer( 85/**
86 * Enforcing no reentrancy for this is best-effort.
87 */
88const downloadServer = notReentrant(async function downloadServer(
86 source: ArtifactSource.GithubRelease, 89 source: ArtifactSource.GithubRelease,
87 config: Config, 90 config: Config,
88): Promise<null | string> { 91): Promise<null | string> {
@@ -112,7 +115,7 @@ async function downloadServer(
112 ); 115 );
113 116
114 return binaryPath; 117 return binaryPath;
115} 118});
116 119
117function isBinaryAvailable(binaryPath: string): boolean { 120function isBinaryAvailable(binaryPath: string): boolean {
118 const res = spawnSync(binaryPath, ["--version"]); 121 const res = spawnSync(binaryPath, ["--version"]);