Skip to content

Commit

Permalink
enable background threads
Browse files Browse the repository at this point in the history
  • Loading branch information
realbigsean committed Feb 11, 2021
1 parent 8805ef9 commit 074ce1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lighthouse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ lighthouse_version = { path = "../common/lighthouse_version" }
account_utils = { path = "../common/account_utils" }
remote_signer = { "path" = "../remote_signer" }
tokio-compat-02 = "0.1"
jemalloc-ctl = "0.3.3"

[dev-dependencies]
tempfile = "3.1.0"
Expand Down
5 changes: 5 additions & 0 deletions lighthouse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::process::exit;
use tokio_compat_02::FutureExt;
use types::{EthSpec, EthSpecId};
use validator_client::ProductionValidatorClient;
use jemalloc_ctl::background_thread;

pub const ETH2_CONFIG_FILENAME: &str = "eth2-spec.toml";

Expand All @@ -26,6 +27,9 @@ fn bls_library_name() -> &'static str {
}

fn main() {

background_thread.write(true).unwrap();

// Parse the CLI parameters.
let matches = App::new("Lighthouse")
.version(VERSION.replace("Lighthouse/", "").as_str())
Expand Down Expand Up @@ -270,6 +274,7 @@ fn run<E: EthSpec>(
"Configured for network";
"name" => &network_name
);
info!(log, "background threads", "enabled" => background_thread.read().unwrap());

match matches.subcommand() {
("beacon_node", Some(matches)) => {
Expand Down

0 comments on commit 074ce1f

Please sign in to comment.