aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-08-30 12:02:09 +0500
committerGitHub <noreply@github.com>2022-08-30 00:02:09 -0700
commit903a06a1600036bc70e0f14c640b1935a7246e0f (patch)
tree5dc2059558664344b3f870d37d1855998619749c /weed/command/filer.go
parent570b4885722ae08c92651d6f38918429ac39bd22 (diff)
downloadseaweedfs-903a06a1600036bc70e0f14c640b1935a7246e0f.tar.xz
seaweedfs-903a06a1600036bc70e0f14c640b1935a7246e0f.zip
avoid data race access to startDelay (#3548)
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index 5c1e653cb..0dd35e5bd 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -173,29 +173,29 @@ func runFiler(cmd *Command, args []string) bool {
if *f.dataCenter != "" && *filerS3Options.dataCenter == "" {
filerS3Options.dataCenter = f.dataCenter
}
- go func() {
- time.Sleep(startDelay * time.Second)
+ go func(delay time.Duration) {
+ time.Sleep(delay * time.Second)
filerS3Options.startS3Server()
- }()
+ }(startDelay)
startDelay++
}
if *filerStartWebDav {
filerWebDavOptions.filer = &filerAddress
- go func() {
- time.Sleep(startDelay * time.Second)
+ go func(delay time.Duration) {
+ time.Sleep(delay * time.Second)
filerWebDavOptions.startWebDav()
- }()
+ }(startDelay)
startDelay++
}
if *filerStartIam {
filerIamOptions.filer = &filerAddress
filerIamOptions.masters = f.mastersString
- go func() {
- time.Sleep(startDelay * time.Second)
+ go func(delay time.Duration) {
+ time.Sleep(delay * time.Second)
filerIamOptions.startIamServer()
- }()
+ }(startDelay)
}
f.masters = pb.ServerAddresses(*f.mastersString).ToAddressMap()