feat: 下线设备保护期
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m30s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m30s
- 后台设备停复机不再设置 1 小时保护期,也不再因保护期拒绝相反操作;单卡手动停复机去掉保护期检查 - 删除保护期一致性轮询(polling:protect)及其强制停复机方法;调度、初始化、监控、匹配预览不再包含保护期;已入队的旧任务由空处理函数直接确认,下一次发布移除 - 轮询配置接口不再接受与返回 protect_check_interval;并发配置不再返回 protect,查询、更新、重置该类型时拒绝 - 资产详情 device_protect_status 固定返回 none 并标记废弃,兼容老版本客户端 - 删除保护期 Redis key 与时长常量;停机原因 protect_period 保留供历史数据与开放接口映射 - 迁移 000249 只把 protect_check_interval、last_protect_check_at 列注释标记为已废弃,不删列不改数据
This commit is contained in:
@@ -417,16 +417,9 @@ func RedisClientPurchaseLockKey(assetType string, assetID uint) string {
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// 设备保护期相关 Redis Key
|
||||
// 设备刷新相关 Redis Key
|
||||
// ========================================
|
||||
|
||||
// RedisDeviceProtectKey 生成设备保护期 Redis 键
|
||||
// action: "stop"(停机保护期)或 "start"(复机保护期),两者互斥
|
||||
// 过期时间:DeviceProtectPeriodDuration(1 小时)
|
||||
func RedisDeviceProtectKey(deviceID uint, action string) string {
|
||||
return fmt.Sprintf("protect:device:%d:%s", deviceID, action)
|
||||
}
|
||||
|
||||
// RedisDeviceRefreshCooldownKey 生成设备刷新冷却期 Redis 键
|
||||
// 用途:防止同一设备短时间内多次调网关刷新(限频)
|
||||
// 过期时间:DeviceRefreshCooldownDuration(30 秒)
|
||||
@@ -434,16 +427,6 @@ func RedisDeviceRefreshCooldownKey(deviceID uint) string {
|
||||
return fmt.Sprintf("refresh:cooldown:device:%d", deviceID)
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// 轮询保护期队列 Redis Key
|
||||
// ========================================
|
||||
|
||||
// RedisPollingQueueProtectKey 保护期一致性检查轮询队列键
|
||||
// 用途:存储需要进行保护期一致性检查的卡 ID(ZSet,按时间排序)
|
||||
func RedisPollingQueueProtectKey() string {
|
||||
return "polling:queue:protect"
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// 微信配置相关 Redis Key
|
||||
// ========================================
|
||||
|
||||
Reference in New Issue
Block a user