aboutsummaryrefslogtreecommitdiff
path: root/weed/wdclient/masterclient.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-06-25 09:22:49 -0700
committerchrislu <chris.lu@gmail.com>2022-06-25 09:22:49 -0700
commit3ce46c35660f7d30354a0678eefd3a5fa2c5f863 (patch)
tree5786dd1517b74d87a63fd9729740784060ed8cf5 /weed/wdclient/masterclient.go
parent9c517d2b358da00c6d8fe638eaa6e8551c65aa8d (diff)
downloadseaweedfs-3ce46c35660f7d30354a0678eefd3a5fa2c5f863.tar.xz
seaweedfs-3ce46c35660f7d30354a0678eefd3a5fa2c5f863.zip
fix entry full url lookup
Diffstat (limited to 'weed/wdclient/masterclient.go')
-rw-r--r--weed/wdclient/masterclient.go5
1 files changed, 4 insertions, 1 deletions
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)
}
}