MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / command_worker_address

Function command_worker_address

crates/hyperqueue/src/bin/hq.rs:318–336  ·  view source on GitHub ↗
(
    gsettings: &GlobalSettings,
    opts: WorkerAddressOpts,
)

Source from the content-addressed store, hash-verified

316}
317
318async fn command_worker_address(
319 gsettings: &GlobalSettings,
320 opts: WorkerAddressOpts,
321) -> anyhow::Result<()> {
322 use hyperqueue::common::arraydef::IntArray;
323 use hyperqueue::transfer::messages::IdSelector;
324
325 let mut session = get_client_session(gsettings.server_directory()).await?;
326 let selector = IdSelector::Specific(IntArray::from_id(opts.worker_id.as_num()));
327 let response = get_worker_info(&mut session, selector, false).await?;
328
329 match response.into_iter().next() {
330 Some((_, Some(info))) => println!("{}", info.configuration.hostname),
331 Some((id, None)) => anyhow::bail!("Worker {} not found", id),
332 None => anyhow::bail!("Worker {} not found", opts.worker_id),
333 }
334
335 Ok(())
336}
337
338#[cfg(feature = "dashboard")]
339/// Starts the hq dashboard

Callers 1

mainFunction · 0.85

Calls 5

get_client_sessionFunction · 0.85
get_worker_infoFunction · 0.85
server_directoryMethod · 0.80
nextMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected