aboutsummaryrefslogtreecommitdiff
path: root/weed/util/retry.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-11-15 16:58:48 -0800
committerChris Lu <chris.lu@gmail.com>2020-11-15 16:58:48 -0800
commit95c0de285d907cbd826ba6ce97f7c4994c16ffd5 (patch)
tree2ef04241b575b8169bf6b1baa2dd15cda4046be7 /weed/util/retry.go
parent500bcab9535835404d29b8f68a03bf2ecf5b2991 (diff)
downloadseaweedfs-95c0de285d907cbd826ba6ce97f7c4994c16ffd5.tar.xz
seaweedfs-95c0de285d907cbd826ba6ce97f7c4994c16ffd5.zip
refactoring
Diffstat (limited to 'weed/util/retry.go')
-rw-r--r--weed/util/retry.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/util/retry.go b/weed/util/retry.go
index faaab0351..85c4d150d 100644
--- a/weed/util/retry.go
+++ b/weed/util/retry.go
@@ -29,3 +29,13 @@ func Retry(name string, job func() error) (err error) {
}
return err
}
+
+// return the first non empty string
+func Nvl(values ...string) string {
+ for _, s := range values {
+ if s != "" {
+ return s
+ }
+ }
+ return ""
+}