diff --git a/core/archipelago/src/api/rpc/fips.rs b/core/archipelago/src/api/rpc/fips.rs index fbf6f715..74f63fde 100644 --- a/core/archipelago/src/api/rpc/fips.rs +++ b/core/archipelago/src/api/rpc/fips.rs @@ -98,21 +98,14 @@ impl RpcHandler { // Anchor bootstrap window: poll the status every ~3s for up to // 20s. Bail as soon as the anchor is connected. - let mut last_status: Option = None; let deadline = std::time::Instant::now() + std::time::Duration::from_secs(20); - loop { + let after = loop { tokio::time::sleep(std::time::Duration::from_secs(3)).await; let s = fips::FipsStatus::query(&self.config.data_dir).await; - if s.anchor_connected { - last_status = Some(s); - break; + if s.anchor_connected || std::time::Instant::now() >= deadline { + break s; } - last_status = Some(s); - if std::time::Instant::now() >= deadline { - break; - } - } - let after = last_status.unwrap_or_else(|| before.clone()); + }; let recovered = after.anchor_connected && !before.anchor_connected; let likely_cause = if after.anchor_connected { diff --git a/core/archipelago/src/api/rpc/package/async_lifecycle.rs b/core/archipelago/src/api/rpc/package/async_lifecycle.rs index cac8be94..5041cd7b 100644 --- a/core/archipelago/src/api/rpc/package/async_lifecycle.rs +++ b/core/archipelago/src/api/rpc/package/async_lifecycle.rs @@ -410,16 +410,6 @@ async fn set_package_state_and_clear_uninstall_stage( } } -/// Remove a package entry from state. Used for install-failure cleanup -/// (since there's no pre-state to revert to — the entry was created -/// speculatively when we flipped to Installing). -async fn remove_package_entry(state_manager: &StateManager, package_id: &str) { - let (mut data, _) = state_manager.get_snapshot().await; - if data.package_data.remove(package_id).is_some() { - state_manager.update_data(data).await; - } -} - /// Kick the container scanner to run immediately and wait for it to finish /// (with a 2s timeout). Used by install/update success paths so the fresh /// manifest — with `interfaces.main.ui` populated from the now-running diff --git a/core/archipelago/src/container/mod.rs b/core/archipelago/src/container/mod.rs index 37140160..cd7771f3 100644 --- a/core/archipelago/src/container/mod.rs +++ b/core/archipelago/src/container/mod.rs @@ -14,8 +14,5 @@ pub mod traits; pub use boot_reconciler::{BootReconciler, DEFAULT_INTERVAL as RECONCILER_DEFAULT_INTERVAL}; pub use dev_orchestrator::DevContainerOrchestrator; pub use docker_packages::DockerPackageScanner; -pub use prod_orchestrator::{ - compute_container_name, AdoptionReport, ProdContainerOrchestrator, ReconcileAction, - ReconcileReport, -}; +pub use prod_orchestrator::ProdContainerOrchestrator; pub use traits::ContainerOrchestrator; diff --git a/core/archipelago/src/container/prod_orchestrator.rs b/core/archipelago/src/container/prod_orchestrator.rs index d4daf77b..3776af26 100644 --- a/core/archipelago/src/container/prod_orchestrator.rs +++ b/core/archipelago/src/container/prod_orchestrator.rs @@ -187,9 +187,9 @@ impl ProdContainerOrchestrator { }) } - /// Test/advanced constructor: inject an arbitrary runtime + manifests dir. - /// - /// This is the entry point used by unit tests with a `MockRuntime`. + /// Test constructor: inject an arbitrary runtime + manifests dir. Used + /// by unit tests with `MockRuntime`. + #[cfg(test)] pub fn with_runtime(runtime: Arc, manifests_dir: PathBuf) -> Self { Self { runtime, @@ -274,7 +274,7 @@ impl ProdContainerOrchestrator { } /// Test helper: inject a manifest directly without touching the filesystem. - #[doc(hidden)] + #[cfg(test)] pub async fn insert_manifest_for_test(&self, manifest: AppManifest, manifest_dir: PathBuf) { let mut state = self.state.write().await; state.manifests.insert( diff --git a/core/archipelago/src/container/registry.rs b/core/archipelago/src/container/registry.rs index ed8f5597..621b09ed 100644 --- a/core/archipelago/src/container/registry.rs +++ b/core/archipelago/src/container/registry.rs @@ -8,7 +8,6 @@ use anyhow::{Context, Result}; use serde::{Deserialize, Serialize}; use std::path::Path; use tokio::fs; -use tracing::{debug, info}; const REGISTRY_FILE: &str = "config/registries.json"; const OVH_REGISTRY_URL: &str = "146.59.87.168:3000/lfg2025";