mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Always install required nightly extension if current one is not nightly
This commit is contained in:
parent
8035b0a27e
commit
69b6f6def5
1 changed files with 8 additions and 4 deletions
|
@ -152,13 +152,17 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
const lastCheck = state.lastCheck;
|
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
|
if (config.package.releaseTag === NIGHTLY_TAG) {
|
||||||
|
// Check if we should poll github api for the new nightly version
|
||||||
|
// if we haven't done it during the past hour
|
||||||
|
const lastCheck = state.lastCheck;
|
||||||
|
|
||||||
const anHour = 60 * 60 * 1000;
|
const anHour = 60 * 60 * 1000;
|
||||||
const shouldDownloadNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour;
|
const shouldCheckForNewNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour;
|
||||||
|
|
||||||
if (!shouldDownloadNightly) return;
|
if (!shouldCheckForNewNightly) return;
|
||||||
|
}
|
||||||
|
|
||||||
const release = await fetchRelease("nightly").catch((e) => {
|
const release = await fetchRelease("nightly").catch((e) => {
|
||||||
log.error(e);
|
log.error(e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue