MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / fetch_worldwide_total

Function fetch_worldwide_total

src/cloud.rs:60–70  ·  view source on GitHub ↗

Fetches the current worldwide total from the worker. Returns None on timeout, network error, or parse failure.

()

Source from the content-addressed store, hash-verified

58/// Fetches the current worldwide total from the worker.
59/// Returns None on timeout, network error, or parse failure.
60pub fn fetch_worldwide_total() -> Option<u64> {
61 let agent = agent_with_timeout(FETCH_TIMEOUT);
62 let parsed: WorkerResponse = agent
63 .get(&format!("{WORKER_URL}/total"))
64 .call()
65 .ok()?
66 .body_mut()
67 .read_json()
68 .ok()?;
69 Some(parsed.total)
70}
71
72/// Response from the worker's GET /countries endpoint.
73#[derive(serde::Deserialize)]

Callers 2

check_networkFunction · 0.85
handle_status_commandFunction · 0.85

Calls 2

agent_with_timeoutFunction · 0.85
callMethod · 0.45

Tested by

no test coverage detected