mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +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:
@@ -83,11 +83,6 @@ pub struct TaskExecutor {
|
||||
/// The task must provide a reason for shutting down.
|
||||
signal_tx: Sender<ShutdownReason>,
|
||||
|
||||
/// The name of the service for inclusion in the logger output.
|
||||
// FIXME(sproul): delete?
|
||||
#[allow(dead_code)]
|
||||
service_name: String,
|
||||
|
||||
rayon_pool_provider: Arc<RayonPoolProvider>,
|
||||
}
|
||||
|
||||
@@ -103,28 +98,15 @@ impl TaskExecutor {
|
||||
handle: T,
|
||||
exit: async_channel::Receiver<()>,
|
||||
signal_tx: Sender<ShutdownReason>,
|
||||
service_name: String,
|
||||
) -> Self {
|
||||
Self {
|
||||
handle_provider: handle.into(),
|
||||
exit,
|
||||
signal_tx,
|
||||
service_name,
|
||||
rayon_pool_provider: Arc::new(RayonPoolProvider::default()),
|
||||
}
|
||||
}
|
||||
|
||||
/// Clones the task executor adding a service name.
|
||||
pub fn clone_with_name(&self, service_name: String) -> Self {
|
||||
TaskExecutor {
|
||||
handle_provider: self.handle_provider.clone(),
|
||||
exit: self.exit.clone(),
|
||||
signal_tx: self.signal_tx.clone(),
|
||||
service_name,
|
||||
rayon_pool_provider: self.rayon_pool_provider.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
/// A convenience wrapper for `Self::spawn` which ignores a `Result` as long as both `Ok`/`Err`
|
||||
/// are of type `()`.
|
||||
///
|
||||
|
||||
@@ -37,7 +37,7 @@ impl Default for TestRuntime {
|
||||
(Some(runtime), handle)
|
||||
};
|
||||
|
||||
let task_executor = TaskExecutor::new(handle, exit, shutdown_tx, "test".to_string());
|
||||
let task_executor = TaskExecutor::new(handle, exit, shutdown_tx);
|
||||
|
||||
Self {
|
||||
runtime,
|
||||
|
||||
Reference in New Issue
Block a user