We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0bc8cf commit f529eddCopy full SHA for f529edd
pkg/server/server.go
@@ -10,7 +10,6 @@ import (
10
"github.com/zeriontech/sidecache/pkg/lock"
11
"io"
12
"io/ioutil"
13
- "math"
14
"net/http"
15
"net/http/httputil"
16
"net/url"
@@ -252,9 +251,9 @@ func (server CacheServer) ReorderQueryString(url *url.URL) string {
252
251
}
253
254
func (server CacheServer) GetBackoff(attempt int) time.Duration {
255
- multiplier := 1
256
- if attempt%2 != 0 {
257
- multiplier = 5
+ if attempt < 10 {
+ return 100 * time.Millisecond
+ } else {
+ return 500 * time.Millisecond
258
259
- return time.Duration(multiplier*int(math.Pow(10, float64(attempt/2+1)))) * time.Millisecond
260
0 commit comments