mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
@@ -109,8 +109,11 @@ TRY:
|
||||
}
|
||||
|
||||
// Wait to avoid thundering herd
|
||||
timer, cancel := helper.NewSafeTimer(helper.RandomStagger(c.config.RPCHoldTimeout / structs.JitterFraction))
|
||||
defer cancel()
|
||||
|
||||
select {
|
||||
case <-time.After(helper.RandomStagger(c.config.RPCHoldTimeout / structs.JitterFraction)):
|
||||
case <-timer.C:
|
||||
// If we are going to retry a blocking query we need to update the time to block so it finishes by our deadline.
|
||||
if info, ok := args.(structs.RPCInfo); ok && info.TimeToBlock() > 0 {
|
||||
newBlockTime := time.Until(deadline)
|
||||
|
||||
Reference in New Issue
Block a user