mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
rename variable
This commit is contained in:
parent
f8ef25099c
commit
58d18b68d8
|
@ -120,11 +120,11 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
|||
}
|
||||
|
||||
var count int
|
||||
var needleSize types.Size
|
||||
var memoryCost types.Size
|
||||
readOption.AttemptMetaOnly, readOption.MustMetaOnly = shouldAttemptStreamWrite(hasVolume, ext, r)
|
||||
onReadSizeFn := func(size types.Size) {
|
||||
needleSize = size
|
||||
atomic.AddInt64(&vs.inFlightDownloadDataSize, int64(needleSize))
|
||||
memoryCost = size
|
||||
atomic.AddInt64(&vs.inFlightDownloadDataSize, int64(memoryCost))
|
||||
}
|
||||
if hasVolume {
|
||||
count, err = vs.store.ReadVolumeNeedle(volumeId, n, readOption, onReadSizeFn)
|
||||
|
@ -132,7 +132,7 @@ func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)
|
|||
count, err = vs.store.ReadEcShardNeedle(volumeId, n, onReadSizeFn)
|
||||
}
|
||||
defer func() {
|
||||
atomic.AddInt64(&vs.inFlightDownloadDataSize, -int64(needleSize))
|
||||
atomic.AddInt64(&vs.inFlightDownloadDataSize, -int64(memoryCost))
|
||||
vs.inFlightDownloadDataLimitCond.Signal()
|
||||
}()
|
||||
|
||||
|
|
Loading…
Reference in a new issue