Skip to content

Commit

Permalink
chore: change default number of connections (#560)
Browse files Browse the repository at this point in the history
and give warning in case it is just one, because it might cause failures
  • Loading branch information
marcospb19-cw authored Apr 10, 2024
1 parent 903f4ce commit 9c12bd1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/importer-online.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EVMS=1
EXTERNAL_RPC=http://spec.testnet.cloudwalk.network:9934/

PERM_STORAGE=inmemory
PERM_STORAGE_CONNECTIONS=1
PERM_STORAGE_CONNECTIONS=2
PERM_STORAGE_TIMEOUT=1000

TEMP_STORAGE=inmemory
2 changes: 1 addition & 1 deletion config/run-with-importer.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EVMS=1
EXTERNAL_RPC=http://spec.testnet.cloudwalk.network:9934/

PERM_STORAGE=rocks
PERM_STORAGE_CONNECTIONS=1
PERM_STORAGE_CONNECTIONS=2
PERM_STORAGE_TIMEOUT=1000

TEMP_STORAGE=inmemory
2 changes: 1 addition & 1 deletion config/state-validator.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ METHOD=http://spec.testnet.cloudwalk.network:9934/

# storages
PERM_STORAGE=inmemory
PERM_STORAGE_CONNECTIONS=1
PERM_STORAGE_CONNECTIONS=2
PERM_STORAGE_TIMEOUT=1000

TEMP_STORAGE=inmemory
2 changes: 1 addition & 1 deletion config/stratus.env.local
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHAIN_ID=2008
EVMS=1

PERM_STORAGE=inmemory
PERM_STORAGE_CONNECTIONS=2
PERM_STORAGE_CONNECTIONS=5
PERM_STORAGE_TIMEOUT=2000

TEMP_STORAGE=inmemory
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::env;
use std::fmt::Debug;

use crate::config::load_dotenv;
Expand All @@ -18,6 +19,10 @@ where
let config = T::parse();
println!("parsed configuration: {:?}", config);

if env::var_os("PERM_STORAGE_CONNECTIONS").is_some_and(|value| value == "1") {
println!("WARNING: env var PERM_STORAGE_CONNECTIONS is set to 1, if it cause connection problems, try increasing it");
}

// init services
infra::init_tracing();
#[cfg(feature = "metrics")]
Expand Down

0 comments on commit 9c12bd1

Please sign in to comment.