mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-01 17:18:31 +08:00
move vs.concurrentUploadLimit != 0 out of the lock
This commit is contained in:
parent
f0ee3e6f21
commit
3076ac101e
@ -59,10 +59,10 @@ func (vs *VolumeServer) privateStoreHandler(w http.ResponseWriter, r *http.Reque
|
|||||||
|
|
||||||
contentLength := getContentLength(r)
|
contentLength := getContentLength(r)
|
||||||
// exclude the replication from the concurrentUploadLimitMB
|
// exclude the replication from the concurrentUploadLimitMB
|
||||||
if r.URL.Query().Get("type") != "replicate" {
|
if r.URL.Query().Get("type") != "replicate" && vs.concurrentUploadLimit != 0 {
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
vs.inFlightUploadDataLimitCond.L.Lock()
|
vs.inFlightUploadDataLimitCond.L.Lock()
|
||||||
for vs.concurrentUploadLimit != 0 && vs.inFlightUploadDataSize > vs.concurrentUploadLimit {
|
for vs.inFlightUploadDataSize > vs.concurrentUploadLimit {
|
||||||
//wait timeout check
|
//wait timeout check
|
||||||
if startTime.Add(vs.inflightUploadDataTimeout).Before(time.Now()) {
|
if startTime.Add(vs.inflightUploadDataTimeout).Before(time.Now()) {
|
||||||
vs.inFlightUploadDataLimitCond.L.Unlock()
|
vs.inFlightUploadDataLimitCond.L.Unlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user