mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
swarm/storage: time memstore.purge
This commit is contained in:
parent
9a5a9ded71
commit
4d7361f65f
1 changed files with 3 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ package storage
|
|||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/metrics"
|
||||
|
|
@ -252,6 +253,8 @@ func (s *MemStore) Get(hash Key) (chunk *Chunk, err error) {
|
|||
}
|
||||
|
||||
func (s *MemStore) removeOldest() {
|
||||
defer metrics.GetOrRegisterResettingTimer("memstore.purge", metrics.DefaultRegistry).UpdateSince(time.Now())
|
||||
|
||||
node := s.memtree
|
||||
log.Warn("purge memstore")
|
||||
for node.entry == nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue