-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the feature
we currently do:
reth/crates/cli/commands/src/db/repair_trie.rs
Lines 59 to 66 in ed104a9
| // Create a single-threaded tokio runtime | |
| let runtime = tokio::runtime::Builder::new_current_thread() | |
| .enable_all() | |
| .build() | |
| .expect("Failed to create tokio runtime for metrics server"); | |
| let handle = runtime.handle().clone(); | |
| runtime.block_on(async move { |
this is a bit verbose and we don't need this really if we change the db command to accept clicontext
reth/crates/cli/commands/src/db/mod.rs
Lines 81 to 82 in ed104a9
| /// Execute `db` command | |
| pub async fn execute<N: CliNodeTypes<ChainSpec = C::ChainSpec>>(self) -> eyre::Result<()> { |
reth/crates/ethereum/cli/src/app.rs
Line 157 in ed104a9
| Commands::Db(command) => runner.run_blocking_until_ctrl_c(command.execute::<N>()), |
we can introduce run_blocking_command_until_exit
reth/crates/cli/runner/src/lib.rs
Line 53 in ed104a9
| pub fn run_command_until_exit<F, E>( |
for this
and forward the clicontext to the command, this way the repair trie command gets access to the TaskExecutor it needs for
reth/crates/cli/commands/src/db/repair_trie.rs
Lines 57 to 58 in ed104a9
| let handle = std::thread::Builder::new().name("metrics-server".to_string()).spawn( | |
| move || { |
| let task_manager = reth_tasks::TaskManager::new(handle.clone()); |
maybe @figtracer ?
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status