fix: 新增 StopReasonProtectPeriod 常量和 RedisCardResumeLockKey 函数
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -59,6 +59,7 @@ const (
|
|||||||
StopReasonTrafficExhausted = "traffic_exhausted" // 流量耗尽
|
StopReasonTrafficExhausted = "traffic_exhausted" // 流量耗尽
|
||||||
StopReasonManual = "manual" // 手动停机
|
StopReasonManual = "manual" // 手动停机
|
||||||
StopReasonArrears = "arrears" // 欠费
|
StopReasonArrears = "arrears" // 欠费
|
||||||
|
StopReasonProtectPeriod = "protect_period" // 保护期一致性检查自动停机
|
||||||
)
|
)
|
||||||
|
|
||||||
// 套餐流量类型
|
// 套餐流量类型
|
||||||
|
|||||||
@@ -289,6 +289,17 @@ func RedisPollingInitProgressKey() string {
|
|||||||
return "polling:init:progress"
|
return "polling:init:progress"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ========================================
|
||||||
|
// 复机并发保护相关 Redis Key
|
||||||
|
// ========================================
|
||||||
|
|
||||||
|
// RedisCardResumeLockKey 生成卡复机操作分布式锁的 Redis 键
|
||||||
|
// 用途:防止同一张卡并发触发多次 gateway.StartCard
|
||||||
|
// 过期时间:30 秒
|
||||||
|
func RedisCardResumeLockKey(cardID uint) string {
|
||||||
|
return fmt.Sprintf("card:resume:lock:%d", cardID)
|
||||||
|
}
|
||||||
|
|
||||||
// ========================================
|
// ========================================
|
||||||
// 套餐激活锁相关键
|
// 套餐激活锁相关键
|
||||||
// ========================================
|
// ========================================
|
||||||
|
|||||||
Reference in New Issue
Block a user