aboutsummaryrefslogtreecommitdiff
path: root/weed
diff options
context:
space:
mode:
Diffstat (limited to 'weed')
-rw-r--r--weed/command/filer_remote_sync_dir.go7
-rw-r--r--weed/command/filer_sync.go4
2 files changed, 8 insertions, 3 deletions
diff --git a/weed/command/filer_remote_sync_dir.go b/weed/command/filer_remote_sync_dir.go
index 00f6d7493..dd3e94be6 100644
--- a/weed/command/filer_remote_sync_dir.go
+++ b/weed/command/filer_remote_sync_dir.go
@@ -278,7 +278,10 @@ func updateLocalEntry(filerClient filer_pb.FilerClient, dir string, entry *filer
}
func isMultipartUploadFile(dir string, name string) bool {
+ return isMultipartUploadDir(dir) && strings.HasSuffix(name, ".part")
+}
+
+func isMultipartUploadDir(dir string) bool {
return strings.HasPrefix(dir, "/buckets/") &&
- strings.Contains(dir, "/"+s3_constants.MultipartUploadsFolder+"/") &&
- strings.HasSuffix(name, ".part")
+ strings.Contains(dir, "/"+s3_constants.MultipartUploadsFolder+"/")
}
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index d84c6325c..dc954e805 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -394,9 +394,11 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str
if debug {
glog.V(0).Infof("received %v", resp)
}
- if strings.Contains(resp.Directory, "/"+s3_constants.MultipartUploadsFolder+"/") {
+
+ if isMultipartUploadDir(resp.Directory) {
return nil
}
+
if !strings.HasPrefix(resp.Directory, sourcePath) {
return nil
}