mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-06 10:00:25 +08:00
优化代码
This commit is contained in:
@@ -41,6 +41,7 @@ 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{
|
||||||
|
|||||||
Reference in New Issue
Block a user