From 4fc0bd1a8173e284ff919edb5214f5adf7a90f06 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 9 Sep 2020 03:53:09 -0700 Subject: return http response directly --- weed/replication/source/filer_source.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'weed/replication/source') diff --git a/weed/replication/source/filer_source.go b/weed/replication/source/filer_source.go index 69c23fe82..ee2c77ef1 100644 --- a/weed/replication/source/filer_source.go +++ b/weed/replication/source/filer_source.go @@ -79,16 +79,16 @@ func (fs *FilerSource) LookupFileId(part string) (fileUrl string, err error) { return } -func (fs *FilerSource) ReadPart(part string) (filename string, header http.Header, readCloser io.ReadCloser, err error) { +func (fs *FilerSource) ReadPart(part string) (filename string, header http.Header, resp *http.Response, err error) { fileUrl, err := fs.LookupFileId(part) if err != nil { return "", nil, nil, err } - filename, header, readCloser, err = util.DownloadFile(fileUrl) + filename, header, resp, err = util.DownloadFile(fileUrl) - return filename, header, readCloser, err + return filename, header, resp, err } var _ = filer_pb.FilerClient(&FilerSource{}) -- cgit v1.2.3 From 387ab6796f274151f802ccdab8756b959b5fb1cb Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 9 Sep 2020 11:21:23 -0700 Subject: filer: cross cluster synchronization --- weed/replication/source/filer_source.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'weed/replication/source') diff --git a/weed/replication/source/filer_source.go b/weed/replication/source/filer_source.go index ee2c77ef1..9106ee98b 100644 --- a/weed/replication/source/filer_source.go +++ b/weed/replication/source/filer_source.go @@ -28,13 +28,13 @@ type FilerSource struct { } func (fs *FilerSource) Initialize(configuration util.Configuration, prefix string) error { - return fs.initialize( + return fs.DoInitialize( configuration.GetString(prefix+"grpcAddress"), configuration.GetString(prefix+"directory"), ) } -func (fs *FilerSource) initialize(grpcAddress string, dir string) (err error) { +func (fs *FilerSource) DoInitialize(grpcAddress string, dir string) (err error) { fs.grpcAddress = grpcAddress fs.Dir = dir fs.grpcDialOption = security.LoadClientTLS(util.GetViper(), "grpc.client") -- cgit v1.2.3