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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
"github.com/ethereum/go-ethereum/metrics"
|
"github.com/ethereum/go-ethereum/metrics"
|
||||||
|
|
@ -252,6 +253,8 @@ func (s *MemStore) Get(hash Key) (chunk *Chunk, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *MemStore) removeOldest() {
|
func (s *MemStore) removeOldest() {
|
||||||
|
defer metrics.GetOrRegisterResettingTimer("memstore.purge", metrics.DefaultRegistry).UpdateSince(time.Now())
|
||||||
|
|
||||||
node := s.memtree
|
node := s.memtree
|
||||||
log.Warn("purge memstore")
|
log.Warn("purge memstore")
|
||||||
for node.entry == nil {
|
for node.entry == nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue