MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / request_with_reconnect

Function request_with_reconnect

atomic-cli/src/commands/agent/owner.rs:835–851  ·  view source on GitHub ↗
(
    repository: &Path,
    request_body: OwnerRequest,
)

Source from the content-addressed store, hash-verified

833}
834
835fn request_with_reconnect(
836 repository: &Path,
837 request_body: OwnerRequest,
838) -> anyhow::Result<OwnerResponse> {
839 start_or_reconnect(repository)?;
840 let mut last_error = None;
841 for _ in 0..3 {
842 match request(repository, request_body.clone()) {
843 Ok(response) => return Ok(response),
844 Err(error) => {
845 last_error = Some(error);
846 start_or_reconnect(repository)?;
847 }
848 }
849 }
850 Err(last_error.unwrap_or_else(|| anyhow!("database owner request retry exhausted")))
851}
852
853fn run_outside_async_runtime<T, F>(operation: F) -> anyhow::Result<T>
854where

Callers 7

reserve_turnMethod · 0.85
appendMethod · 0.85
prepare_checkpointMethod · 0.85
load_frozen_envelopesMethod · 0.85
bind_checkpoint_hashMethod · 0.85
request_turn_lifecycleFunction · 0.85

Calls 3

start_or_reconnectFunction · 0.85
requestFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected