move to util.RetryWaitTime

This commit is contained in:
Chris Lu
2020-11-01 02:36:43 -08:00
parent ef908e166b
commit 8750cac090
7 changed files with 17 additions and 20 deletions

View File

@@ -3,20 +3,16 @@ package filer
import (
"context"
"fmt"
"io"
"math/rand"
"sync"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/chrislusf/seaweedfs/weed/util/chunk_cache"
"github.com/chrislusf/seaweedfs/weed/wdclient"
"github.com/golang/groupcache/singleflight"
"io"
"math/rand"
"sync"
"time"
)
var (
ReadWaitTime = 6 * time.Second
)
type ChunkReadAt struct {
@@ -47,7 +43,7 @@ func LookupFn(filerClient filer_pb.FilerClient) LookupFileIdFunctionType {
vicCacheLock.RUnlock()
if !found {
util.Retry("lookup volume "+vid, ReadWaitTime, func() error {
util.Retry("lookup volume "+vid, func() error {
err = filerClient.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
resp, err := client.LookupVolume(context.Background(), &filer_pb.LookupVolumeRequest{
VolumeIds: []string{vid},