Files
BlueArchiveToolkit/infrastructure
nyaKazuhaandClaude Fable 5 232d74b617 fix(daemon): 串行化 bat-status.json 的读-改-写
watch 循环线程(update_daemon_status/update_daemon_progress)与 RPC 处理线程
(update_daemon_state_only)都会对状态文件做“读→改字段→写回”。单次写虽原子,
但整段读-改-写非原子,无互斥时并发线程会 last-writer-wins 丢失对方的字段更新。

新增进程级 DAEMON_STATUS_FILE_LOCK,三处读-改-写函数入口统一获取该锁串行化
(锁中毒时取 into_inner 继续,不 panic)。

对应 issue #18 维护清单 3-4。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 09:38:46 -07:00
..
2026-07-12 23:04:13 +08:00