Skip to main content

set_service_lease

Function set_service_lease 

Source
pub fn set_service_lease(
    service: &str,
    request: Json<LeaseUpdateRequest>,
    _actor: Actor,
    pool: &State<DbPool>,
) -> Result<Json<ServiceDto>, Status>
Expand description

Sets (or clears) a service’s per-service lease / visibility timeout — the agent twin of the registry screen’s inline “lease” form (D-17). Token-gated via the Actor guard (401 without a valid token); 400 if seconds is non-positive, 404 if the service is unknown, 200 with the updated ServiceDto on success. null clears the override (the service falls back to the global dispatcher lease). Takes effect on the next dispatch — an already-leased task keeps the timeout captured when it was leased.