mirror of
https://github.com/zhouxiaoka/autoclip.git
synced 2026-10-02 02:34:34 +08:00
fix: make database cleanup fail with a non-zero exit (#112)
A caught exception used to end the process with status 0, so callers treated a failed wipe as success. Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kris K <zhouxiaoka@users.noreply.github.com>
This commit is contained in:
co-authored by
Cursor Agent
Kris K
parent
de4dee377e
commit
619a0867e4
+2
-1
@@ -7,7 +7,8 @@
|
|||||||
|
|
||||||
## [未发布]
|
## [未发布]
|
||||||
|
|
||||||
_(本周尚无改动)_
|
### 修复
|
||||||
|
- 数据库清理脚本失败时返回退出码 1。之前异常被接住后进程仍以 0 退出,调用方会以为清理已经成功。
|
||||||
|
|
||||||
## [1.3.1] - 2026-09-21
|
## [1.3.1] - 2026-09-21
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ def clean_database():
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"❌ 清理数据库时发生错误: {e}")
|
print(f"❌ 清理数据库时发生错误: {e}")
|
||||||
db.rollback()
|
db.rollback()
|
||||||
|
sys.exit(1)
|
||||||
finally:
|
finally:
|
||||||
db.close()
|
db.close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user