优化代码

This commit is contained in:
GoEdgeLab
2022-03-12 19:45:22 +08:00
parent b3043f4ca9
commit 34f81e3f5a

View File

@@ -41,7 +41,8 @@ type MemoryStorage struct {
locker *sync.RWMutex locker *sync.RWMutex
valuesMap map[uint64]*MemoryItem // hash => item valuesMap map[uint64]*MemoryItem // hash => item
dirtyChan chan string // hash chan
dirtyChan chan string // hash chan
purgeTicker *utils.Ticker purgeTicker *utils.Ticker
@@ -434,6 +435,7 @@ func (this *MemoryStorage) flushItem(key string) {
if err != nil { if err != nil {
_ = writer.Discard() _ = writer.Discard()
remotelogs.Error("CACHE", "flush items failed: close writer failed: "+err.Error()) remotelogs.Error("CACHE", "flush items failed: close writer failed: "+err.Error())
return
} }
this.parentStorage.AddToList(&Item{ this.parentStorage.AddToList(&Item{