修复事务重复收尾状态
防止正常提交后的保护性收尾再次覆盖已提交状态,确保事务最终记录稳定。
This commit is contained in:
parent
a14d040e3f
commit
9b386bbde2
@ -404,6 +404,7 @@ func (s *Service) deployOne(ctx context.Context, server Server, artifact Artifac
|
|||||||
result.FailureCode = ""
|
result.FailureCode = ""
|
||||||
result.Message = "证书已推送并重载,等待站点校验"
|
result.Message = "证书已推送并重载,等待站点校验"
|
||||||
closed := false
|
closed := false
|
||||||
|
finished := false
|
||||||
transaction := &pendingDeployment{index: index}
|
transaction := &pendingDeployment{index: index}
|
||||||
transaction.restore = func(recoveryContext context.Context) Result {
|
transaction.restore = func(recoveryContext context.Context) Result {
|
||||||
result.Status = "failed"
|
result.Status = "failed"
|
||||||
@ -445,6 +446,10 @@ func (s *Service) deployOne(ctx context.Context, server Server, artifact Artifac
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
transaction.finish = func(retain bool) Result {
|
transaction.finish = func(retain bool) Result {
|
||||||
|
if finished {
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
finished = true
|
||||||
if !closed {
|
if !closed {
|
||||||
retainLocks = retain
|
retainLocks = retain
|
||||||
releaseLocks()
|
releaseLocks()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user