mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Fix creating rocksdb cache (#989)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
1433f23eff
commit
c7fd75ce56
4 changed files with 11 additions and 5 deletions
|
@ -64,10 +64,14 @@ Result<RocksDb> RocksDb::open(std::string path, RocksDbOptions options) {
|
|||
{
|
||||
rocksdb::Options db_options;
|
||||
|
||||
static auto cache = rocksdb::NewLRUCache(options.block_cache_size);
|
||||
static auto cache = rocksdb::NewLRUCache(1 << 30);
|
||||
|
||||
rocksdb::BlockBasedTableOptions table_options;
|
||||
table_options.block_cache = cache;
|
||||
if (options.block_cache_size) {
|
||||
table_options.block_cache = rocksdb::NewLRUCache(options.block_cache_size.value());
|
||||
} else {
|
||||
table_options.block_cache = cache;
|
||||
}
|
||||
db_options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(table_options));
|
||||
|
||||
db_options.manual_wal_flush = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue