写缓存失败时,允许继续读取源站内容

This commit is contained in:
GoEdgeLab
2023-12-27 20:55:12 +08:00
parent 0f76de73ee
commit e7fb706d8a
3 changed files with 16 additions and 7 deletions

View File

@@ -125,7 +125,6 @@ func (this *MemoryWriter) Close() error {
// 需要在Locker之外
defer this.once.Do(func() {
this.endFunc(this.item)
this.item = nil // free memory
})
if this.item == nil {
@@ -164,7 +163,6 @@ func (this *MemoryWriter) Discard() error {
// 需要在Locker之外
defer this.once.Do(func() {
this.endFunc(this.item)
this.item = nil // free memory
})
this.storage.locker.Lock()