加分布式锁
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m0s

This commit is contained in:
Break
2026-06-09 10:54:13 +08:00
parent 4ccbf13197
commit 6a70713b30
5 changed files with 88 additions and 16 deletions

View File

@@ -449,6 +449,13 @@ func RedisPackageUsageRemainderKey(carrierType string, carrierID uint) string {
return fmt.Sprintf("package:usage:remainder:%s:%d", carrierType, carrierID)
}
// RedisCardTrafficSyncLockKey 生成卡流量同步锁 Redis 键
// 用途:串行化轮询与手动刷新,避免同一上游读数被重复扣减套餐流量
// 过期时间10 分钟
func RedisCardTrafficSyncLockKey(cardID uint) string {
return fmt.Sprintf("traffic:sync:lock:card:%d", cardID)
}
// ========================================
// 轮询分片队列相关 Redis Key
// ========================================