perf(disk): remove runtime caches left by earlier versions after startup

This commit is contained in:
mesalogo
2026-10-04 09:45:50 +08:00
parent 91edcf5e8b
commit ae4c6d2423
5 changed files with 151 additions and 1 deletions
+10
View File
@@ -65,6 +65,8 @@ import {
import { createTrayIcon } from './tray-icon'
import { resolveBundledRuntimePaths } from './agent/bundled-runtimes'
import type { ContinueHostLauncher } from './agent/continue-host-adapter'
import { CONTINUE_HOST_LAYOUT_VERSION } from './agent/continue-host-layout'
import { removeStaleRuntimeCaches } from './stale-runtime-cache-cleanup'
import { resolvePortableUserDataPath } from './portable-user-data'
import { BrowserService } from './browser/browser-service'
import { SubagentService } from './assistant/subagent-service'
@@ -1626,6 +1628,14 @@ if (hasSingleInstanceLock) {
startupMark('main:load-main-window')
removeDeviceSharingIpc = registerDeviceSharingIpc(mainWindow,
new DeviceSharingService(join(app.getPath('userData'), 'device-sharing-settings.json'), app.getVersion()))
// Disk only: old versions' runtime caches, removed well after the first frame.
setTimeout(() => {
void removeStaleRuntimeCaches({
userDataPath: app.getPath('userData'),
appVersion: app.getVersion(),
continueHostLayoutVersion: CONTINUE_HOST_LAYOUT_VERSION
})
}, 30_000).unref()
setImmediate(() => {
void repairStaleWindowsNotificationShortcuts({
platform: process.platform,