优化代码

This commit is contained in:
GoEdgeLab
2023-10-02 08:18:43 +08:00
parent 59cca9c6c7
commit 42150681d0
4 changed files with 4 additions and 5 deletions

View File

@@ -223,7 +223,7 @@ func (this *MemoryStorage) openWriter(key string, expiresAt int64, status int, h
delete(this.writingKeyMap, key)
this.locker.Unlock()
if valueItem != nil && valueItem.IsDone {
if valueItem != nil {
valueItem.TotalSize = int64(len(valueItem.HeaderValue) + len(valueItem.BodyValue) + len(key) + 256 /** meta size **/)
atomic.AddInt64(&this.usedSize, valueItem.TotalSize)