add clean memory
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user