fix: 修复轮询停机连坐、实名逆转防抖及carrier_stopped原因写入缺失三个逻辑缺陷
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m37s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m37s
This commit is contained in:
@@ -48,6 +48,9 @@ const (
|
||||
RealNameStatusVerified = 1 // 已实名
|
||||
)
|
||||
|
||||
// PollingRealnameReversalThreshold 实名逆转防抖阈值:连续 N 次检测到逆转才触发停机
|
||||
const PollingRealnameReversalThreshold = 3
|
||||
|
||||
// IoT 卡网络状态
|
||||
const (
|
||||
NetworkStatusOffline = 0 // 停机
|
||||
@@ -62,6 +65,7 @@ const (
|
||||
StopReasonProtectPeriod = "protect_period" // 保护期一致性检查自动停机
|
||||
StopReasonNoPackage = "no_package" // 停机原因:无有效套餐
|
||||
StopReasonNotRealname = "not_realname" // 停机原因:非行业卡且未完成实名认证
|
||||
StopReasonCarrierStopped = "carrier_stopped" // 停机原因:运营商/Gateway 侧主动停机
|
||||
)
|
||||
|
||||
// 套餐流量类型
|
||||
|
||||
@@ -420,6 +420,12 @@ func RedisPollingShardQueueKey(shardID int, taskType string) string {
|
||||
return fmt.Sprintf("polling:shard:%d:queue:%s", shardID, taskType)
|
||||
}
|
||||
|
||||
// RedisPollingRealnameReversalCountKey 实名逆转连续计数器,防止上游单次误报触发停机
|
||||
// TTL: 10分钟
|
||||
func RedisPollingRealnameReversalCountKey(cardID uint) string {
|
||||
return fmt.Sprintf("polling:card:realname:reversal:%d", cardID)
|
||||
}
|
||||
|
||||
// RedisPollingDeviceOpLockKey 设备维度停复机操作锁 Key
|
||||
// 防止设备下多张卡并发触发 EvaluateAndAct 导致重复 Gateway 调用
|
||||
// TTL 建议 30 秒(覆盖 stopDeviceCards/resumeDeviceCards 最长执行时间)
|
||||
|
||||
Reference in New Issue
Block a user