From 3ce46c35660f7d30354a0678eefd3a5fa2c5f863 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 25 Jun 2022 09:22:49 -0700 Subject: [PATCH] fix entry full url lookup --- weed/wdclient/masterclient.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go index a6f7e49a4..03ef593ed 100644 --- a/weed/wdclient/masterclient.go +++ b/weed/wdclient/masterclient.go @@ -44,6 +44,9 @@ func (mc *MasterClient) GetLookupFileIdFunction() LookupFileIdFunctionType { func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []string, err error) { fullUrls, err = mc.vidMap.LookupFileId(fileId) + if err == nil { + return + } err = pb.WithMasterClient(false, mc.currentMaster, mc.grpcDialOption, func(client master_pb.SeaweedClient) error { resp, err := client.LookupVolume(context.Background(), &master_pb.LookupVolumeRequest{ VolumeOrFileIds: []string{fileId}, @@ -59,7 +62,7 @@ func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []stri GrpcPort: int(vidLoc.GrpcPort), } mc.vidMap.addLocation(uint32(vid), loc) - fullUrls = append(fullUrls, loc.Url) + fullUrls = append(fullUrls, "http://"+loc.Url+"/"+fileId) } }