Skip to main content

update_server

Function update_server 

Source
pub async fn update_server(
    state: &AppState,
    server_id: ServerId,
    form: ServerForm,
    status_tx: UnboundedSender<String>,
) -> Result<UpdateOutcome>
Expand description

Update a running server by id, applying only the fields the caller set.

  • Unknown id → clean error, nothing mutated.
  • Protocol mismatch → error (protocol is immutable; recreate to change it).
  • startup_params / event_handlers are validated before the running instance is touched, so a bad update leaves the old instance working.
  • Hot fields (instruction, memory, event handlers, feedback instructions, scheduled tasks) are applied in place, preserving live connections.
  • Binding fields (port, host, interface, mac) or a startup_params change force a clean stop+start; this drops connections and is reported as such.