From df4d59512e496ff010c8710e8ea8e2db4a7f4822 Mon Sep 17 00:00:00 2001 From: Matthias Einwag Date: Wed, 23 Sep 2020 08:27:25 -0700 Subject: Remane function --- editors/code/src/main.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'editors/code/src') diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 0ee5280cc..f865639a1 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -177,7 +177,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi if (!shouldCheckForNewNightly) return; } - const release = await performDownloadWithRetryDialog(state, async () => { + const release = await downloadWithRetryDialog(state, async () => { return await fetchRelease("nightly", state.githubToken); }).catch((e) => { log.error(e); @@ -199,7 +199,7 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi const dest = path.join(config.globalStoragePath, "rust-analyzer.vsix"); - await performDownloadWithRetryDialog(state, async () => { + await downloadWithRetryDialog(state, async () => { // Unlinking the exe file before moving new one on its place should prevent ETXTBSY error. await fs.unlink(dest).catch(err => { if (err.code !== "ENOENT") throw err; @@ -323,13 +323,13 @@ async function getServer(config: Config, state: PersistentState): Promise { + const release = await downloadWithRetryDialog(state, async () => { return await fetchRelease(releaseTag, state.githubToken); }); const artifact = release.assets.find(artifact => artifact.name === `rust-analyzer-${platform}.gz`); assert(!!artifact, `Bad release: ${JSON.stringify(release)}`); - await performDownloadWithRetryDialog(state, async () => { + await downloadWithRetryDialog(state, async () => { // Unlinking the exe file before moving new one on its place should prevent ETXTBSY error. await fs.unlink(dest).catch(err => { if (err.code !== "ENOENT") throw err; @@ -353,7 +353,7 @@ async function getServer(config: Config, state: PersistentState): Promise(state: PersistentState, downloadFunc: () => Promise): Promise { +async function downloadWithRetryDialog(state: PersistentState, downloadFunc: () => Promise): Promise { while (true) { try { return await downloadFunc(); -- cgit v1.2.3