File tree Expand file tree Collapse file tree 4 files changed +6
-3
lines changed Expand file tree Collapse file tree 4 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
3636
3737## [ Unreleased]
3838
39+ * (cache) Change cache-capacity unit to MiB
40+
3941## [ v0.1.5] ( https://github.com/initia-labs/kvindexer/releases/tag/v0.1.5 ) - 2024-07-16
4042
4143### KVIndexer breaking
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ func (c IndexerConfig) IsEnabled() bool {
5959func DefaultConfig () IndexerConfig {
6060 return IndexerConfig {
6161 Enable : true ,
62- CacheCapacity : 500 * 1024 * 1024 , // 500MiB
62+ CacheCapacity : 500 , // 500 MiB
6363 BackendConfig : store .DefaultConfig (),
6464 }
6565}
Original file line number Diff line number Diff line change @@ -20,11 +20,12 @@ const DefaultConfigTemplate = `
2020# Enable defines whether the indexer is enabled.
2121enable = {{ .IndexerConfig.Enable }}
2222
23- # CacheCapacity defines the size of the cache. (unit: bytes )
23+ # CacheCapacity defines the size of the cache. (unit: MiB )
2424cache-capacity = {{ .IndexerConfig.CacheCapacity }}
2525
2626# Backend defines the type of the backend store and its options.
2727# It should have a key-value pair named 'type', and the value should exist in store supported by cosmos-db.
28+ # Recommend to use default value unless you know about backend db storage.
2829# supported type: "goleveldb" only in current
2930[indexer.backend]
3031{{ range $key, $value := .IndexerConfig.BackendConfig.AllSettings }}{{ printf "%s = \"%v\"\n" $key $value }}{{end}}
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ func (k *Keeper) Seal() error {
9999
100100 k .schema = & schema
101101
102- k .store = store .NewCacheStore (dbadapter.Store {DB : k .db }, k .config .CacheCapacity )
102+ k .store = store .NewCacheStore (dbadapter.Store {DB : k .db }, k .config .CacheCapacity * 1024 * 1024 )
103103 k .sealed = true
104104
105105 return nil
You can’t perform that action at this time.
0 commit comments