Skip to content

Commit a0b9169

Browse files
committed
v1.8.10
1 parent 4773afa commit a0b9169

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cursor-pool",
33
"private": true,
4-
"version": "1.8.9",
4+
"version": "1.8.10",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cursor-pool"
3-
version = "1.8.9"
3+
version = "1.8.10"
44
description = "Cursor Pool App"
55
authors = ["Cloxl"]
66
edition = "2021"

src-tauri/src/cursor_reset/commands.rs

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,6 @@ pub async fn cleanup_database_entries(
10171017
) -> Result<(), String> {
10181018
error!(target: "database_cleanup", "开始清理数据库条目");
10191019

1020-
// 从 db_state 创建 AppPaths 实例
10211020
let app_paths = match AppPaths::new_with_db(Some(&db_state)) {
10221021
Ok(p) => p,
10231022
Err(e) => {
@@ -1062,7 +1061,42 @@ pub async fn cleanup_database_entries(
10621061
Err(e) => {
10631062
let err_msg = format!("删除键 {} 失败: {}", key, e);
10641063
error!(target: "database_cleanup", "{}", err_msg);
1065-
//可以选择在这里返回错误,或者继续尝试删除其他键
1064+
}
1065+
}
1066+
}
1067+
1068+
let patterns = vec![
1069+
"cursor%/machineId",
1070+
"cursor%/deviceId",
1071+
"cursor%/macAddress",
1072+
"cursor%/history%",
1073+
"cursor%/cache%"
1074+
];
1075+
1076+
for pattern in patterns {
1077+
match conn.execute(
1078+
"DELETE FROM ItemTable WHERE key GLOB ?1 AND key NOT GLOB 'cursorAuth/*'",
1079+
[pattern],
1080+
) {
1081+
Ok(rows_affected) => {
1082+
if rows_affected > 0 {
1083+
error!(
1084+
target: "database_cleanup",
1085+
"已删除{}个匹配'{}'的条目",
1086+
rows_affected,
1087+
pattern
1088+
);
1089+
} else {
1090+
error!(
1091+
target: "database_cleanup",
1092+
"没有找到匹配'{}'的条目",
1093+
pattern
1094+
);
1095+
}
1096+
}
1097+
Err(e) => {
1098+
let err_msg = format!("删除模式 {} 的条目失败: {}", pattern, e);
1099+
error!(target: "database_cleanup", "{}", err_msg);
10661100
}
10671101
}
10681102
}
@@ -1079,7 +1113,7 @@ pub async fn cleanup_database_entries(
10791113
Err(e) => {
10801114
let err_msg = format!("设置键 {} 失败: {}", key_to_upsert, e);
10811115
error!(target: "database_cleanup", "{}", err_msg);
1082-
return Err(err_msg); // 如果这个关键操作失败,则返回错误
1116+
return Err(err_msg);
10831117
}
10841118
}
10851119

0 commit comments

Comments
 (0)