MCPcopy
hub / github.com/21st-dev/1code / checkForUpdates

Function checkForUpdates

src/main/lib/auto-updater.ts:281–298  ·  view source on GitHub ↗
(force = false)

Source from the content-addressed store, hash-verified

279 * @param force - Skip the minimum interval check
280 */
281export async function checkForUpdates(force = false) {
282 if (!app.isPackaged) {
283 log.info("[AutoUpdater] Skipping update check in dev mode")
284 return Promise.resolve(null)
285 }
286
287 // Respect minimum interval to prevent spam
288 const now = Date.now()
289 if (!force && now - lastCheckTime < MIN_CHECK_INTERVAL) {
290 log.info(
291 `[AutoUpdater] Skipping check - last check was ${Math.round((now - lastCheckTime) / 1000)}s ago`,
292 )
293 return Promise.resolve(null)
294 }
295
296 lastCheckTime = now
297 return autoUpdater.checkForUpdates()
298}
299
300/**
301 * Start downloading the update

Callers 3

buildMenuFunction · 0.90
index.tsFile · 0.90
setupFocusUpdateCheckFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected