| 142 | } |
| 143 | |
| 144 | fn block_on( |
| 145 | future: impl Future<Output = Result<(), Report<GraphError>>>, |
| 146 | service_name: &'static str, |
| 147 | tracing_config: TracingConfig, |
| 148 | ) -> Result<(), Report<GraphError>> { |
| 149 | tokio::runtime::Builder::new_multi_thread() |
| 150 | .enable_all() |
| 151 | .build() |
| 152 | .expect("failed to create runtime") |
| 153 | .block_on(async { |
| 154 | let _telemetry_guard = init_tracing(tracing_config, service_name) |
| 155 | .expect("should be able to initialize telemetry"); |
| 156 | |
| 157 | future.await |
| 158 | }) |
| 159 | } |
| 160 | |
| 161 | impl Subcommand { |
| 162 | pub(crate) fn execute(self, tracing_config: TracingConfig) -> Result<(), Report<GraphError>> { |