fix: 修复已激活在线卡无有效套餐时未被轮询停机的问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m3s

- 新增 activated 轮询配置覆盖已实名+在线的卡(此前仅 real_name 配置)
- HandleCarddataCheck 添加独立停机/复机检查(不依赖流量增量)
- shouldStopCard 对齐 hasAvailablePackage 逻辑,检查待生效+生效中套餐
- 新增复机安全网:流量耗尽停机的卡检测到有效套餐后自动复机
- 卡缓存补充 stop_reason 字段支持复机判断
This commit is contained in:
2026-03-31 20:51:42 +08:00
parent 724967b8b8
commit 950c0bfb8f
4 changed files with 135 additions and 18 deletions

View File

@@ -538,6 +538,7 @@ func (s *Scheduler) initCardsBatch(ctx context.Context, cards []*model.IotCard)
"real_name_status": card.RealNameStatus,
"network_status": card.NetworkStatus,
"carrier_id": card.CarrierID,
"stop_reason": card.StopReason,
"cached_at": now.Unix(),
}
pipe.HSet(ctx, cacheKey, cacheData)
@@ -689,6 +690,7 @@ func (s *Scheduler) cacheCardInfo(ctx context.Context, card *model.IotCard, cach
"real_name_status": card.RealNameStatus,
"network_status": card.NetworkStatus,
"carrier_id": card.CarrierID,
"stop_reason": card.StopReason,
"cached_at": cachedAt.Unix(),
}