feat: 重建 MediaMTX 生命周期与状态对账 (#67)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package reconcile
|
||||
|
||||
import "time"
|
||||
|
||||
func Backoff(failures int) time.Duration {
|
||||
if failures <= 1 {
|
||||
return time.Second
|
||||
}
|
||||
d := time.Second
|
||||
for i := 1; i < failures; i++ {
|
||||
if d >= 30*time.Second {
|
||||
return time.Minute
|
||||
}
|
||||
d *= 2
|
||||
}
|
||||
return d
|
||||
}
|
||||
Reference in New Issue
Block a user