mirror of
https://github.com/soypat/lneto.git
synced 2026-08-03 06:27:52 +00:00
Stack backoff rework (#83)
* huge Stack backoff rework * lneto bump: huge Stack backoff rework
This commit is contained in:
@@ -190,7 +190,7 @@ func run() (err error) {
|
||||
}
|
||||
}()
|
||||
|
||||
rstack := stack.StackRetrying(5 * time.Millisecond)
|
||||
rstack := stack.StackRetrying(stackBackoff)
|
||||
|
||||
const (
|
||||
dhcpTimeout = 6 * time.Second
|
||||
@@ -354,3 +354,10 @@ func tryPoll(iface ltesto.Interface, poll time.Duration) (dataMayBeReady bool, _
|
||||
dataMayBeReady = true
|
||||
return dataMayBeReady, nil
|
||||
}
|
||||
|
||||
func stackBackoff(consecutiveBackoffs uint) time.Duration {
|
||||
if consecutiveBackoffs < 10 {
|
||||
return time.Millisecond
|
||||
}
|
||||
return 10 * time.Millisecond
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user