diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/src/main.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 5ceab8b44..1ad75a03c 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -152,13 +152,17 @@ async function bootstrapExtension(config: Config, state: PersistentState): Promi | |||
152 | return; | 152 | return; |
153 | }; | 153 | }; |
154 | 154 | ||
155 | const lastCheck = state.lastCheck; | ||
156 | const now = Date.now(); | 155 | const now = Date.now(); |
156 | if (config.package.releaseTag === NIGHTLY_TAG) { | ||
157 | // Check if we should poll github api for the new nightly version | ||
158 | // if we haven't done it during the past hour | ||
159 | const lastCheck = state.lastCheck; | ||
157 | 160 | ||
158 | const anHour = 60 * 60 * 1000; | 161 | const anHour = 60 * 60 * 1000; |
159 | const shouldDownloadNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour; | 162 | const shouldCheckForNewNightly = state.releaseId === undefined || (now - (lastCheck ?? 0)) > anHour; |
160 | 163 | ||
161 | if (!shouldDownloadNightly) return; | 164 | if (!shouldCheckForNewNightly) return; |
165 | } | ||
162 | 166 | ||
163 | const release = await fetchRelease("nightly").catch((e) => { | 167 | const release = await fetchRelease("nightly").catch((e) => { |
164 | log.error(e); | 168 | log.error(e); |