From cb1dbd31351ad7900b8c4acc4fd6c7f862088325 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 1 Aug 2021 11:53:46 -0700 Subject: [PATCH] refactor --- weed/topology/store_replicate.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/weed/topology/store_replicate.go b/weed/topology/store_replicate.go index ea0a8c968..6d68bb26f 100644 --- a/weed/topology/store_replicate.go +++ b/weed/topology/store_replicate.go @@ -50,7 +50,7 @@ func ReplicatedWrite(masterFn operation.GetMasterFn, s *storage.Store, volumeId } if len(remoteLocations) > 0 { //send to other replica locations - if err = distributedOperation(remoteLocations, s, func(location operation.Location) error { + if err = DistributedOperation(remoteLocations, func(location operation.Location) error { u := url.URL{ Scheme: "http", Host: location.Url, @@ -115,7 +115,7 @@ func ReplicatedDelete(masterFn operation.GetMasterFn, store *storage.Store, } if len(remoteLocations) > 0 { //send to other replica locations - if err = distributedOperation(remoteLocations, store, func(location operation.Location) error { + if err = DistributedOperation(remoteLocations, func(location operation.Location) error { return util.Delete("http://"+location.Url+r.URL.Path+"?type=replicate", string(jwt)) }); err != nil { size = 0 @@ -144,7 +144,7 @@ type RemoteResult struct { Error error } -func distributedOperation(locations []operation.Location, store *storage.Store, op func(location operation.Location) error) error { +func DistributedOperation(locations []operation.Location, op func(location operation.Location) error) error { length := len(locations) results := make(chan RemoteResult) for _, location := range locations {