MCPcopy Create free account
hub / github.com/Commit-Boost/commit-boost-client / reload

Function reload

crates/pbs/src/mev_boost/reload.rs:8–27  ·  view source on GitHub ↗

Reload the PBS state with the latest configuration in the config file Returns 200 if successful or 500 if failed

(state: PbsState<S>)

Source from the content-addressed store, hash-verified

6/// Reload the PBS state with the latest configuration in the config file
7/// Returns 200 if successful or 500 if failed
8pub async fn reload<S: BuilderApiState>(state: PbsState<S>) -> eyre::Result<PbsState<S>> {
9 let pbs_config = load_pbs_config().await?;
10 let new_state = PbsState::new(pbs_config).with_data(state.data);
11
12 if state.config.pbs_config.host != new_state.config.pbs_config.host {
13 warn!(
14 "Host change for PBS module require a full restart. Old: {}, New: {}",
15 state.config.pbs_config.host, new_state.config.pbs_config.host
16 );
17 }
18
19 if state.config.pbs_config.port != new_state.config.pbs_config.port {
20 warn!(
21 "Port change for PBS module require a full restart. Old: {}, New: {}",
22 state.config.pbs_config.port, new_state.config.pbs_config.port
23 );
24 }
25
26 Ok(new_state)
27}

Callers 2

reloadMethod · 0.85
handle_reloadFunction · 0.85

Calls 2

load_pbs_configFunction · 0.85
with_dataMethod · 0.80

Tested by

no test coverage detected