mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
refactor
This commit is contained in:
parent
be166b434f
commit
15b66a6633
|
@ -278,7 +278,10 @@ func updateLocalEntry(filerClient filer_pb.FilerClient, dir string, entry *filer
|
|||
}
|
||||
|
||||
func isMultipartUploadFile(dir string, name string) bool {
|
||||
return strings.HasPrefix(dir, "/buckets/") &&
|
||||
strings.Contains(dir, "/"+s3_constants.MultipartUploadsFolder+"/") &&
|
||||
strings.HasSuffix(name, ".part")
|
||||
return isMultipartUploadDir(dir) && strings.HasSuffix(name, ".part")
|
||||
}
|
||||
|
||||
func isMultipartUploadDir(dir string) bool {
|
||||
return strings.HasPrefix(dir, "/buckets/") &&
|
||||
strings.Contains(dir, "/"+s3_constants.MultipartUploadsFolder+"/")
|
||||
}
|
||||
|
|
|
@ -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…
Reference in a new issue