MCPcopy Create free account
hub / github.com/base/base / stop_task

Method stop_task

bin/base/src/commands/bootnode.rs:100–112  ·  view source on GitHub ↗
(
        layer: &'static str,
        task: JoinHandle<eyre::Result<()>>,
    )

Source from the content-addressed store, hash-verified

98 }
99
100 async fn stop_task(
101 layer: &'static str,
102 task: JoinHandle<eyre::Result<()>>,
103 ) -> eyre::Result<()> {
104 task.abort();
105 match task.await {
106 Ok(result) => {
107 result.wrap_err_with(|| format!("{layer} bootnode exited while stopping"))
108 }
109 Err(error) if error.is_cancelled() => Ok(()),
110 Err(error) => Err(eyre::eyre!("{layer} bootnode task failed while stopping: {error}")),
111 }
112 }
113
114 fn task_result(
115 layer: &'static str,

Callers

nothing calls this directly

Calls 2

abortMethod · 0.80
is_cancelledMethod · 0.45

Tested by

no test coverage detected