mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +00:00
refactor: remove service_name (#8606)
Which issue # does this PR address? #8586 Please list or describe the changes introduced by this PR. Remove `service_name` from `TaskExecutor` Co-Authored-By: Abhivansh <31abhivanshj@gmail.com>
This commit is contained in:
@@ -109,19 +109,6 @@ pub struct RuntimeContext<E: EthSpec> {
|
||||
}
|
||||
|
||||
impl<E: EthSpec> RuntimeContext<E> {
|
||||
/// Returns a sub-context of this context.
|
||||
///
|
||||
/// The generated service will have the `service_name` in all it's logs.
|
||||
pub fn service_context(&self, service_name: String) -> Self {
|
||||
Self {
|
||||
executor: self.executor.clone_with_name(service_name),
|
||||
eth_spec_instance: self.eth_spec_instance.clone(),
|
||||
eth2_config: self.eth2_config.clone(),
|
||||
eth2_network_config: self.eth2_network_config.clone(),
|
||||
sse_logging_components: self.sse_logging_components.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the `eth2_config` for this service.
|
||||
pub fn eth2_config(&self) -> &Eth2Config {
|
||||
&self.eth2_config
|
||||
@@ -349,23 +336,6 @@ impl<E: EthSpec> Environment<E> {
|
||||
Arc::downgrade(self.runtime()),
|
||||
self.exit.clone(),
|
||||
self.signal_tx.clone(),
|
||||
"core".to_string(),
|
||||
),
|
||||
eth_spec_instance: self.eth_spec_instance.clone(),
|
||||
eth2_config: self.eth2_config.clone(),
|
||||
eth2_network_config: self.eth2_network_config.clone(),
|
||||
sse_logging_components: self.sse_logging_components.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns a `Context` where the `service_name` is added to the logger output.
|
||||
pub fn service_context(&self, service_name: String) -> RuntimeContext<E> {
|
||||
RuntimeContext {
|
||||
executor: TaskExecutor::new(
|
||||
Arc::downgrade(self.runtime()),
|
||||
self.exit.clone(),
|
||||
self.signal_tx.clone(),
|
||||
service_name,
|
||||
),
|
||||
eth_spec_instance: self.eth_spec_instance.clone(),
|
||||
eth2_config: self.eth2_config.clone(),
|
||||
|
||||
Reference in New Issue
Block a user