File tree 1 file changed +13
-10
lines changed
1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,20 @@ type RetryStrategy interface {
13
13
14
14
func NewRetryStrategyFromMetadata (m datastore.Metadata ) RetryStrategy {
15
15
if string (m .Strategy ) == string (datastore .ExponentialStrategyProvider ) {
16
- // 10 seconds to 15 mins
17
- return NewExponential ([]uint {
18
- 10000 , // 10 seconds
19
- 30000 , // 30 seconds
20
- 60000 , // 1 minute
21
- 180000 , // 3 minutes
22
- 300000 , // 5 minutes
23
- 600000 , // 10 minutes
24
- 900000 , // 15 minutes
25
- })
16
+ return NewExponential (getProgression (uint (m .IntervalSeconds ), uint (m .RetryLimit )))
26
17
}
27
18
28
19
return NewDefault (m .IntervalSeconds )
29
20
}
21
+
22
+ func getProgression (start , limit uint ) []uint {
23
+ pgs := make ([]uint , limit )
24
+
25
+ n := start
26
+ for i := range pgs {
27
+ pgs [i ] = n
28
+ n *= 2
29
+ }
30
+
31
+ return pgs
32
+ }
You can’t perform that action at this time.
0 commit comments