refactor: organize Rust modules and simplify deployment README

This commit is contained in:
junior
2026-10-17 22:59:25 +08:00
parent 68c972dadd
commit ceb3e5e2b5
37 changed files with 1029 additions and 1225 deletions
+21
View File
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: GPL-2.0-only
use super::State;
use crate::error::{Error, Result};
use actix_web::{web, HttpResponse};
pub(super) async fn job_files(state: State, id: web::Path<String>) -> Result<HttpResponse> {
Ok(HttpResponse::Ok().json(state.store.file_report(&id).await?))
}
pub(super) async fn check_job_files(state: State, id: web::Path<String>) -> Result<HttpResponse> {
Ok(HttpResponse::Ok().json(state.check_job_files(&id).await?))
}
pub(super) async fn jobs(state: State) -> Result<HttpResponse> {
Ok(HttpResponse::Ok().json(state.store.jobs().await?))
}
pub(super) async fn retry(state: State, id: web::Path<String>) -> Result<HttpResponse> {
let _guard = state.gate.try_lock().map_err(|_| Error::Busy)?;
state.store.retry(&id).await?;
Ok(HttpResponse::NoContent().finish())
}