all: force re-bootstrapping with timeout error

This commit is contained in:
Cuong Manh Le
2023-12-08 23:23:33 +07:00
committed by Cuong Manh Le
parent e92619620d
commit 684019c2e3
2 changed files with 9 additions and 2 deletions

View File

@@ -426,8 +426,9 @@ func (uc *UpstreamConfig) ReBootstrap() {
return
}
_, _, _ = uc.g.Do("ReBootstrap", func() (any, error) {
ProxyLogger.Load().Debug().Msg("re-bootstrapping upstream ip")
uc.rebootstrap.Store(true)
if uc.rebootstrap.CompareAndSwap(false, true) {
ProxyLogger.Load().Debug().Msg("re-bootstrapping upstream ip")
}
return true, nil
})
}