fix(console): reduce duplicate KV writes from routine heartbeats - #407
Merged
Conversation
Co-Authored-By: Codex <noreply@openai.com>
Co-Authored-By: Codex <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
运行目标状态没有变化时,每次定时心跳仍会额外重写滚动审计列表,增加免费 KV 写入消耗。现在始终保存最新完整快照与原始读回时间,只跳过状态未变化的重复同步审计。单次稳定心跳的 KV 写入从两次降为一次。
首次发布、实际状态变化、异常和恢复、过期证据恢复、调度读回变化仍记录审计;人工操作审计不变。已有快照缺失、损坏或读取失败不会阻断有效新快照的保存。未更改数据有效期、认证、账户配置或交易保护,也未升级套餐。
验证:操作计数回归在旧实现中确认重复写入;修复后 Worker 集成验证、停用保护和 Binance 恢复保护测试通过。新增状态过期恢复回归同样先失败再通过;说明文档区分测试计数、按调度估算和实际账户统计。真实告警分类仍待 Cloudflare 登录后读取。