aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-08-07 00:55:34 -0700
committerchrislu <chris.lu@gmail.com>2022-08-07 00:55:34 -0700
commit0e9478488dcf0773662b1469e946b3cad9fd21f9 (patch)
treed1781cf898a1cf0d63f2c0db9e62d71e9ef347e4
parent8a880a139d81b3c0ee14d0f22a2f569abb1a48b6 (diff)
downloadseaweedfs-0e9478488dcf0773662b1469e946b3cad9fd21f9.tar.xz
seaweedfs-0e9478488dcf0773662b1469e946b3cad9fd21f9.zip
filer.sync: fix when excluded paths is empty
-rw-r--r--weed/command/filer_sync.go4
-rw-r--r--weed/util/fullpath.go6
2 files changed, 8 insertions, 2 deletions
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go
index fe1606d8c..9d5b9d831 100644
--- a/weed/command/filer_sync.go
+++ b/weed/command/filer_sync.go
@@ -143,7 +143,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
grpcDialOption,
filerA,
*syncOptions.aPath,
- strings.Split(*syncOptions.aExcludePaths, ","),
+ util.Split(*syncOptions.aExcludePaths, ","),
*syncOptions.aProxyByFiler,
filerB,
*syncOptions.bPath,
@@ -179,7 +179,7 @@ func runFilerSynchronize(cmd *Command, args []string) bool {
grpcDialOption,
filerB,
*syncOptions.bPath,
- strings.Split(*syncOptions.bExcludePaths, ","),
+ util.Split(*syncOptions.bExcludePaths, ","),
*syncOptions.bProxyByFiler,
filerA,
*syncOptions.aPath,
diff --git a/weed/util/fullpath.go b/weed/util/fullpath.go
index f52d4d1d0..92580dc38 100644
--- a/weed/util/fullpath.go
+++ b/weed/util/fullpath.go
@@ -63,3 +63,9 @@ func Join(names ...string) string {
func JoinPath(names ...string) FullPath {
return FullPath(Join(names...))
}
+func Split(separatedValues string, sep string) []string {
+ if separatedValues == "" {
+ return nil
+ }
+ return strings.Split(separatedValues, sep)
+}