Browse Source

refactor

pull/5223/head
chrislu 11 months ago
parent
commit
15b66a6633
  1. 7
      weed/command/filer_remote_sync_dir.go
  2. 4
      weed/command/filer_sync.go

7
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+"/")
}

4
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
}

Loading…
Cancel
Save