add back AdjustedUrl() related code

This commit is contained in:
Chris Lu
2021-01-28 14:36:29 -08:00
parent 9292796ec2
commit 990fa69bfe
10 changed files with 31 additions and 2 deletions

View File

@@ -25,3 +25,10 @@ func (wfs *WFS) WithFilerClient(fn func(filer_pb.SeaweedFilerClient) error) erro
return err
}
func (wfs *WFS) AdjustedUrl(location *filer_pb.Location) string {
if wfs.option.OutsideContainerClusterMode {
return location.PublicUrl
}
return location.Url
}

View File

@@ -44,7 +44,7 @@ func (wfs *WFS) saveDataAsChunk(fullPath util.FullPath) filer.SaveDataAsChunkFun
Url: resp.Url,
PublicUrl: resp.PublicUrl,
}
host = loc.Url
host = wfs.AdjustedUrl(loc)
collection, replication = resp.Collection, resp.Replication
return nil