feat: add desktop storage cleanup controls
This commit is contained in:
@@ -70,6 +70,11 @@ import { createRuntimeAccountSnapshot, createRuntimeSnapshot } from './runtime-s
|
||||
import { initScheduler } from './scheduler'
|
||||
import { initSessionRegistry } from './session-registry'
|
||||
import { initSingleInstance } from './single-instance'
|
||||
import {
|
||||
cleanDesktopStorage,
|
||||
getDesktopStorageSnapshot,
|
||||
startStorageCleanupScheduler,
|
||||
} from './storage-cleaner'
|
||||
import {
|
||||
cancelDesktopTask,
|
||||
checkDesktopClientRelease,
|
||||
@@ -1085,12 +1090,18 @@ function registerBridgeHandlers(): void {
|
||||
safeHandle(
|
||||
'desktop:set-app-setting',
|
||||
async (_event, key: DesktopAppSettingKey, value: boolean) => {
|
||||
if (key !== 'openAtLogin' && key !== 'keepRunningInBackground') {
|
||||
if (
|
||||
key !== 'openAtLogin' &&
|
||||
key !== 'keepRunningInBackground' &&
|
||||
key !== 'autoCleanStorageWeekly'
|
||||
) {
|
||||
throw new Error('unsupported_app_setting')
|
||||
}
|
||||
return setDesktopAppSetting(key, value)
|
||||
},
|
||||
)
|
||||
safeHandle('desktop:storage-snapshot', () => getDesktopStorageSnapshot())
|
||||
safeHandle('desktop:clean-storage', () => cleanDesktopStorage())
|
||||
safeHandle(
|
||||
'desktop:runtime-session-sync',
|
||||
(_event, session: DesktopRuntimeSessionSyncRequest | null) => {
|
||||
@@ -1168,6 +1179,7 @@ if (!hasSingleInstanceLock) {
|
||||
initAccountHealth()
|
||||
initTransport()
|
||||
initScheduler()
|
||||
startStorageCleanupScheduler()
|
||||
initProcessMetricsSampler()
|
||||
startHotViewReaper()
|
||||
startHiddenPlaywrightReaper()
|
||||
|
||||
Reference in New Issue
Block a user