Files
junhong_cmp_fiber/migrations/000102_add_polling_protect_fields.up.sql
huang 8980e6d999
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m11s
fix: 补全三处轮询覆盖缺口
问题一:protect 轮询任务从未被调度器初始化入队
PollingConfig 新增 protect_check_interval 字段(NULL=不参与),
调度器 initCardsBatch/initCardPolling/requeueCard 补全 protect 队列
初始化逻辑,IotCard 新增 last_protect_check_at 记录上次检查时间。
迁移文件:000102_add_polling_protect_fields

问题二:设备套餐流量耗尽时绑定卡未被停机
UsageService.checkAndTriggerSuspension 新增 carrier_type=device 分支,
通过 DeviceSimBindingStore.ListByDeviceID 查询绑定卡,对每张卡异步
触发 CheckAndStopCard,同步注入 Bootstrap 依赖。

问题三:主套餐过期后不立即停机,依赖下次轮询兜底
PackageActivationHandler.processExpiredPackage 在 updateCarrierSuspended
Status 后,若载体无后续生效套餐,立即异步调用 CheckAndStopCard(iot_card
类型直接触发,device 类型遍历绑定卡),消除停机延迟窗口。

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-04-02 14:36:24 +08:00

13 lines
552 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- 添加 protect 队列所需字段
-- tb_polling_config: 新增保护期检查间隔字段
ALTER TABLE tb_polling_config
ADD COLUMN IF NOT EXISTS protect_check_interval INT NULL;
COMMENT ON COLUMN tb_polling_config.protect_check_interval IS '保护期一致性检查间隔NULL=不参与';
-- tb_iot_card: 新增上次保护期检查时间字段
ALTER TABLE tb_iot_card
ADD COLUMN IF NOT EXISTS last_protect_check_at TIMESTAMP NULL;
COMMENT ON COLUMN tb_iot_card.last_protect_check_at IS '上次保护期一致性检查时间';