完善Nginx本地激活身份校验并通过Linux重复验证
This commit is contained in:
1 parent
cc94a6181b
commit
87589612cb
15 files changed
+741
-48
No files matched your search
@@ -99,10 +99,17 @@ func (e Endpoint) Wait(ctx context.Context, expected []byte) error {
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(ctx, 20*time.Second)
|
||||
defer cancel()
|
||||
matched := 0
|
||||
for {
|
||||
_, err := e.Check(ctx, expected)
|
||||
if err == nil {
|
||||
return nil
|
||||
matched++
|
||||
// 平滑重载期间新旧工作进程可能短暂并存,单次命中不足以确认切换。
|
||||
if matched == 3 {
|
||||
return nil
|
||||
}
|
||||
} else {
|
||||
matched = 0
|
||||
}
|
||||
timer := time.NewTimer(100 * time.Millisecond)
|
||||
select {
|
||||
|
||||
Reference in new issue
Block a user