diff --git a/cmd/thanos/store.go b/cmd/thanos/store.go index 86dfb249c3..618ef99c65 100644 --- a/cmd/thanos/store.go +++ b/cmd/thanos/store.go @@ -49,10 +49,10 @@ import ( "github.com/thanos-io/thanos/pkg/ui" ) -// const ( -// timeoutDuration = 15 -// intervalDuration = 5 -// ) +const ( + timeoutDuration = 15 + intervalDuration = 5 +) type storeConfig struct { indexCacheConfigs extflag.PathOrContent @@ -388,11 +388,11 @@ func runStore( begin := time.Now() //This will stop retrying after 15 seconds. - initialSyncCtx, cancel := context.WithTimeout(context.Background(), 15*time.Second) + initialSyncCtx, cancel := context.WithTimeout(context.Background(), timeoutDuration*time.Second) defer cancel() //If error occurs, it will re-try after every 5 seconds, but only for 15 seconds, (so total re-try is three). - err := runutil.Retry(5*time.Second, initialSyncCtx.Done(), func() error { + err := runutil.Retry(intervalDuration*time.Second, initialSyncCtx.Done(), func() error { return bs.InitialSync(ctx) })