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

@@ -16,7 +16,7 @@ func EnsureVisited(mc *MetaCache, client filer_pb.FilerClient, dirPath util.Full
glog.V(4).Infof("ReadDirAllEntries %s ...", path)
util.Retry("ReadDirAllEntries", filer.ReadWaitTime, func() error {
util.Retry("ReadDirAllEntries", func() error {
err = filer_pb.ReadDirAllEntries(client, dirPath, "", func(pbEntry *filer_pb.Entry, isLast bool) error {
entry := filer.FromPbEntry(string(dirPath), pbEntry)
if err := mc.doInsertEntry(context.Background(), entry); err != nil {

View File

@@ -1,7 +1,6 @@
package filesys
import (
"github.com/chrislusf/seaweedfs/weed/filer"
"github.com/chrislusf/seaweedfs/weed/util"
"google.golang.org/grpc"
@@ -13,7 +12,7 @@ var _ = filer_pb.FilerClient(&WFS{})
func (wfs *WFS) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) error {
err := util.Retry("filer grpc", filer.ReadWaitTime, func() error {
err := util.Retry("filer grpc", func() error {
return pb.WithCachedGrpcClient(func(grpcConnection *grpc.ClientConn) error {
client := filer_pb.NewSeaweedFilerClient(grpcConnection)
return fn(client)