rustploy 0.1.2

Rustploy PaaS daemon — lightweight self-hosted deployment platform
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! `Command::DeployHistory`: últimos deployments de um serviço, com o `live`
//! velho corrigido por `reconcile::fix_stale_live`.

use crate::api::AppState;
use shared::Response as RpResponse;

pub async fn handle(state: AppState, service_id: String, limit: usize) -> RpResponse {
    match crate::db::deployments::list_for_service(&state.db, &service_id, limit).await {
        Ok(deps) => {
            let deps = super::reconcile::fix_stale_live(&state, deps).await;
            RpResponse::Deployments(deps)
        }
        Err(e) => RpResponse::err("DatabaseError", e.to_string()),
    }
}