Chris Lu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
1 deletions
-
weed/server/volume_server_handlers.go
|
@ -52,7 +52,10 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque |
|
|
|
|
|
|
|
|
// wait until in flight data is less than the limit
|
|
|
// wait until in flight data is less than the limit
|
|
|
contentLength := getContentLength(r) |
|
|
contentLength := getContentLength(r) |
|
|
if vs.concurrentUploadLimit != 0 && atomic.LoadInt64(&vs.inFlightUploadDataSize) > vs.concurrentUploadLimit { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// exclude the replication from the concurrentUploadLimitMB
|
|
|
|
|
|
if vs.concurrentUploadLimit != 0 && r.URL.Query().Get("type") != "replicate" && |
|
|
|
|
|
atomic.LoadInt64(&vs.inFlightUploadDataSize) > vs.concurrentUploadLimit { |
|
|
err := fmt.Errorf("reject because inflight upload data %d > %d", vs.inFlightUploadDataSize, vs.concurrentUploadLimit) |
|
|
err := fmt.Errorf("reject because inflight upload data %d > %d", vs.inFlightUploadDataSize, vs.concurrentUploadLimit) |
|
|
glog.V(1).Infof("too many requests: %v", err) |
|
|
glog.V(1).Infof("too many requests: %v", err) |
|
|
writeJsonError(w, r, http.StatusTooManyRequests, err) |
|
|
writeJsonError(w, r, http.StatusTooManyRequests, err) |
|
|