Merge pull request #4075 from LuttyYang/leveldb_shard_fix

Fix leveldb shard log bug
pull/4081/head
Haodi 3 years ago committed by GitHub
commit 3e4aab1b53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      internal/shardchain/local_cache/local_cache_database.go

@ -4,11 +4,9 @@ import (
"bytes"
"time"
"github.com/harmony-one/harmony/internal/utils"
"go.uber.org/zap"
"github.com/allegro/bigcache"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/harmony-one/harmony/internal/utils"
)
type cacheWrapper struct {
@ -53,7 +51,11 @@ func NewLocalCacheDatabase(remoteDB ethdb.KeyValueStore, cacheConfig CacheConfig
go func() {
for range time.Tick(time.Minute) {
utils.GetLogger().Info("local-cache", zap.Any("stats", cache.Stats()), zap.Int("count", cache.Len()), zap.Int("size", cache.Capacity()))
utils.Logger().Info().
Interface("stats", cache.Stats()).
Int("count", cache.Len()).
Int("size", cache.Capacity()).
Msg("local-cache stats")
}
}()

Loading…
Cancel
Save