fix: 停复机成功后上游状态滞后导致暂停轮询的卡到期或退款漏停
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m29s

- 停复机成功后保护窗口内(polling.stop_resume.status_grace_seconds,默认 300 秒)查卡状态返回操作前的状态视为上游滞后,不回写网络状态
- 套餐到期、退款场景不看库里的开停状态,资产无可用主套餐即停机,上游已停时按已是目标状态结束
- 迁移 000257 插入保护窗口配置

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
邹进
2026-10-26 10:41:45 +09:00
parent f6a740b9f3
commit d4fde99cc3
11 changed files with 109 additions and 5 deletions

View File

@@ -0,0 +1,2 @@
-- 回滚停复机成功后的状态保护窗口配置。
DELETE FROM tb_system_config WHERE config_key = 'polling.stop_resume.status_grace_seconds';

View File

@@ -0,0 +1,7 @@
-- 停复机成功后的状态保护窗口(add-stop-resume-command-queue 测试中发现的问题修复)。
-- 背景:停复机成功后上游要几十秒到几分钟才返回新状态,期间查卡状态拿到的是操作前的旧值并被写回库里;
-- 暂停轮询的卡在此期间套餐到期或退款时,判断以为卡已是目标状态而漏停。
-- polling.stop_resume.status_grace_seconds:停复机成功后多少秒内,查卡状态返回操作前的状态视为上游滞后、不回写;0 表示不保护。
INSERT INTO tb_system_config (config_key, config_value, value_type, module, description, is_readonly, is_sensitive, creator, updater, created_at, updated_at) VALUES
('polling.stop_resume.status_grace_seconds', '300', 'int', 'polling', '停复机成功后的状态保护窗口(秒):窗口内查卡状态返回操作前的状态视为上游滞后,不回写;0 不保护', FALSE, FALSE, 0, 0, NOW(), NOW())
ON CONFLICT (config_key) DO NOTHING;