rustploy 0.1.37

Rustploy PaaS daemon — lightweight self-hosted deployment platform
1
2
3
4
5
6
7
8
9
10
11
12
//! `Command::DeployQueuePause`: pausa/retoma a fila global de deploys.

use crate::bootstrap::state::AppState;
use shared::{Event, Response as RpResponse};

/// Pausa (`true`) ou retoma (`false`) a fila global. Pausada, o worker não puxa
/// o próximo deploy; o que já estiver rodando segue até o fim.
pub async fn handle(state: AppState, paused: bool) -> RpResponse {
    state.deploy_queue.set_paused(paused);
    state.bus.publish(Event::DeployQueueChanged);
    RpResponse::Ok
}