Skip to content

Commit

Permalink
use constants defining db file limits
Browse files Browse the repository at this point in the history
  • Loading branch information
biryukovmaxim committed Sep 28, 2023
1 parent 5aa7068 commit bbad2de
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions kaspad/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,8 @@ do you confirm? (answer y/n or pass --yes to the Kaspad command line to confirm

// DB used for addresses store and for multi-consensus management
let mut meta_db = kaspa_database::prelude::ConnBuilder::default()
.with_files_limit(META_DB_FILE_LIMIT)
.with_db_path(meta_db_dir.clone())
.with_files_limit(5.max(fd_total_budget * 5 / 100))
.with_files_limit(META_DB_FILE_LIMIT.max(fd_total_budget * 5 / 100))
.build()
.unwrap();

Expand All @@ -221,9 +220,8 @@ do you confirm? (answer y/n or pass --yes to the Kaspad command line to confirm

// Reopen the DB
meta_db = kaspa_database::prelude::ConnBuilder::default()
.with_files_limit(META_DB_FILE_LIMIT)
.with_db_path(meta_db_dir)
.with_files_limit(5.max(fd_total_budget * 5 / 100))
.with_files_limit(META_DB_FILE_LIMIT.max(fd_total_budget * 5 / 100))
.build()
.unwrap();
}
Expand Down Expand Up @@ -280,9 +278,8 @@ do you confirm? (answer y/n or pass --yes to the Kaspad command line to confirm
let index_service: Option<Arc<IndexService>> = if args.utxoindex {
// Use only a single thread for none-consensus databases
let utxoindex_db = kaspa_database::prelude::ConnBuilder::default()
.with_files_limit(UTXO_INDEX_DB_FILE_LIMIT)
.with_db_path(utxoindex_db_dir)
.with_files_limit(10.max(fd_total_budget * 15 / 100))
.with_files_limit(UTXO_INDEX_DB_FILE_LIMIT.max(fd_total_budget * 15 / 100))
.build()
.unwrap();
let utxoindex = UtxoIndexProxy::new(UtxoIndex::new(consensus_manager.clone(), utxoindex_db).unwrap());
Expand Down

0 comments on commit bbad2de

Please sign in to comment.