fix: 停复机成功后上游状态滞后导致暂停轮询的卡到期或退款漏停
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m29s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m29s
- 停复机成功后保护窗口内(polling.stop_resume.status_grace_seconds,默认 300 秒)查卡状态返回操作前的状态视为上游滞后,不回写网络状态 - 套餐到期、退款场景不看库里的开停状态,资产无可用主套餐即停机,上游已停时按已是目标状态结束 - 迁移 000257 插入保护窗口配置 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -78,6 +78,20 @@ type Service struct {
|
||||
trafficCalc *TrafficCalcPolicy
|
||||
// logger 记录快照写入失败等不影响观测结果的告警;未注入时不输出。
|
||||
logger *zap.Logger
|
||||
// commandGrace 返回停复机成功后的状态保护窗口;未注入时不保护。
|
||||
commandGrace func(ctx context.Context) time.Duration
|
||||
}
|
||||
|
||||
// SetCommandGrace 注入停复机成功后的状态保护窗口(受控系统配置 polling.stop_resume.status_grace_seconds)。
|
||||
func (s *Service) SetCommandGrace(grace func(ctx context.Context) time.Duration) {
|
||||
s.commandGrace = grace
|
||||
}
|
||||
|
||||
func (s *Service) currentCommandGrace(ctx context.Context) time.Duration {
|
||||
if s == nil || s.commandGrace == nil {
|
||||
return 0
|
||||
}
|
||||
return s.commandGrace(ctx)
|
||||
}
|
||||
|
||||
// SetTrafficCalcPolicy 注入卡流量计量切换策略与告警日志。
|
||||
|
||||
Reference in New Issue
Block a user