fmt: apply cargo fmt to missions
This commit is contained in:
@@ -164,11 +164,7 @@ pub async fn insert(pool: &PgPool, m: NewMission<'_>) -> Result<Uuid, DbError> {
|
||||
|
||||
/// Workspace-scoped fetch — returns None when the id belongs to a
|
||||
/// different workspace so callers can't leak cross-workspace metadata.
|
||||
pub async fn get(
|
||||
pool: &PgPool,
|
||||
id: Uuid,
|
||||
workspace_id: Uuid,
|
||||
) -> Result<Option<Mission>, DbError> {
|
||||
pub async fn get(pool: &PgPool, id: Uuid, workspace_id: Uuid) -> Result<Option<Mission>, DbError> {
|
||||
use sqlx::Row;
|
||||
let row = sqlx::query(
|
||||
"SELECT id, workspace_id, title, template_kind, team_id,
|
||||
@@ -288,11 +284,7 @@ pub async fn phases_for(pool: &PgPool, mission_id: Uuid) -> Result<Vec<MissionPh
|
||||
.collect())
|
||||
}
|
||||
|
||||
pub async fn set_phase_status(
|
||||
pool: &PgPool,
|
||||
phase_id: Uuid,
|
||||
status: &str,
|
||||
) -> Result<(), DbError> {
|
||||
pub async fn set_phase_status(pool: &PgPool, phase_id: Uuid, status: &str) -> Result<(), DbError> {
|
||||
let is_start = status == "running";
|
||||
let is_end = matches!(status, "completed" | "failed" | "skipped");
|
||||
sqlx::query(
|
||||
@@ -409,10 +401,7 @@ pub struct RegisterArtifact<'a> {
|
||||
|
||||
/// Register an artifact discovered on disk (or produced inline).
|
||||
/// Idempotent on (mission_id, path).
|
||||
pub async fn register_artifact(
|
||||
pool: &PgPool,
|
||||
a: RegisterArtifact<'_>,
|
||||
) -> Result<Uuid, DbError> {
|
||||
pub async fn register_artifact(pool: &PgPool, a: RegisterArtifact<'_>) -> Result<Uuid, DbError> {
|
||||
use sqlx::Row;
|
||||
let render_status = if a.render_pdf { "pending" } else { "skip" };
|
||||
let row = sqlx::query(
|
||||
@@ -482,10 +471,7 @@ pub async fn artifacts_for(
|
||||
/// PDF renderer worker (Slice 6) picks a pending artifact off the
|
||||
/// queue. Skips the FOR UPDATE dance until we see concurrent renderers
|
||||
/// — one renderer per process is fine for the first cut.
|
||||
pub async fn next_pdf_pending(
|
||||
pool: &PgPool,
|
||||
limit: i64,
|
||||
) -> Result<Vec<MissionArtifact>, DbError> {
|
||||
pub async fn next_pdf_pending(pool: &PgPool, limit: i64) -> Result<Vec<MissionArtifact>, DbError> {
|
||||
use sqlx::Row;
|
||||
let rows = sqlx::query(
|
||||
"SELECT id, mission_id, phase_id, path, kind, mime,
|
||||
|
||||
Reference in New Issue
Block a user