add clean memory

This commit is contained in:
Julian Freeman
2026-03-03 22:03:36 -04:00
parent 0c77149c9e
commit 92adfd7a2e
5 changed files with 501 additions and 16 deletions

View File

@@ -60,6 +60,23 @@ async fn start_browser_clean(browser: String, profiles: Vec<String>) -> Result<c
cleaner::run_browser_clean(b_type, profiles).await
}
// --- 内存清理命令 ---
#[tauri::command]
async fn get_memory_stats() -> cleaner::MemoryStats {
cleaner::get_memory_stats()
}
#[tauri::command]
async fn run_memory_clean() -> Result<u64, String> {
cleaner::run_memory_clean().await
}
#[tauri::command]
async fn run_deep_memory_clean() -> Result<u64, String> {
cleaner::run_deep_memory_clean().await
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
@@ -78,7 +95,10 @@ pub fn run() {
clean_thumbnails,
disable_hibernation,
start_browser_scan,
start_browser_clean
start_browser_clean,
get_memory_stats,
run_memory_clean,
run_deep_memory_clean
])
.run(tauri::generate_context!())
.expect("error while running tauri application");