diff options
| author | chrislu <chris.lu@gmail.com> | 2022-06-15 23:19:39 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-06-15 23:19:39 -0700 |
| commit | e024586ff11d025ce2dd27822a2b04e01260fb6c (patch) | |
| tree | 14d05b1ceeed8a6df731d88fa6f8a04fe988d95b | |
| parent | 82f3bcc65ebbd9514862dcf44a63dcc22603c701 (diff) | |
| download | seaweedfs-e024586ff11d025ce2dd27822a2b04e01260fb6c.tar.xz seaweedfs-e024586ff11d025ce2dd27822a2b04e01260fb6c.zip | |
adjust conditions
| -rw-r--r-- | weed/server/volume_server_handlers.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/server/volume_server_handlers.go b/weed/server/volume_server_handlers.go index 293f36f14..f219dc9b9 100644 --- a/weed/server/volume_server_handlers.go +++ b/weed/server/volume_server_handlers.go @@ -59,7 +59,8 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque contentLength := getContentLength(r) // exclude the replication from the concurrentUploadLimitMB - if r.URL.Query().Get("type") != "replicate" && vs.concurrentUploadLimit != 0 { + shouldWatchUploadLimit := r.URL.Query().Get("type") != "replicate" && vs.concurrentUploadLimit != 0 + if shouldWatchUploadLimit { startTime := time.Now() vs.inFlightUploadDataLimitCond.L.Lock() for vs.inFlightUploadDataSize > vs.concurrentUploadLimit { @@ -79,7 +80,7 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque atomic.AddInt64(&vs.inFlightUploadDataSize, contentLength) defer func() { atomic.AddInt64(&vs.inFlightUploadDataSize, -contentLength) - if vs.concurrentUploadLimit != 0 { + if shouldWatchUploadLimit { vs.inFlightUploadDataLimitCond.Signal() } }() |
