Skip to main content

update_if_idle

Function update_if_idle 

Source
pub(crate) async fn update_if_idle(
    cm: &ContainerManager,
    container_name: &str,
    configured_image: &str,
    provider: &str,
    block_id: &str,
    broker: &Arc<Broker>,
    filestore: &Arc<FileStore>,
    mstore: &Arc<Store>,
) -> bool
Expand description

Moves an idle agent’s container to this AgentMux’s agent image: when it runs an older one, the agent follows the default image (no pin, no image of its own), the current image is already on this machine, and no turn is using the container. The container is removed (workspace, memory and the CLI volume stay; tools installed inside it are installed again) and the pane is told; the start that follows creates it from the current image. Returns whether it did. Anything else leaves the “outdated” row and its button as they are.

Run where nothing is mid-turn (the pre-start): a turn holds the update gate shared for its whole length, so called from inside a turn this finds the gate taken and does nothing.