forked from yvv/decision
Lot V : « Pas avant des votes prouvés » (Yvv, 03/11) — un texte entré par des votes simulés est en vigueur sur le site, la publication attend que tout ce qui est en vigueur tienne sur les seuls votes prouvés (publish::waits_for_proven_votes, simulation::unproven), LD_PUBLISH_SIMULATED=1 publie quand même ; publication.waitsFor ; vu rouge puis vert
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -958,15 +958,17 @@ pub async fn publication_status(state: &AppState, doc_id: &str) -> AppResult<ser
|
||||
.bind(doc_id)
|
||||
.fetch_optional(&state.db)
|
||||
.await?;
|
||||
// Waiting, not failing: no article in force, nothing goes out (ADR 0011).
|
||||
let suspended = match &last {
|
||||
Some(r) if r.done_at.is_none() => crate::publish::waits_for_a_text(state, doc_id).await?,
|
||||
_ => false,
|
||||
// Waiting, not failing: no article in force (ADR 0011), or something in effect that
|
||||
// does not hold on the proven votes yet (ADR 0012) — nothing goes out.
|
||||
let waits = match &last {
|
||||
Some(r) if r.done_at.is_none() => crate::publish::waits(state, doc_id).await?,
|
||||
_ => None,
|
||||
};
|
||||
Ok(match last {
|
||||
None => json!({ "state": "none", "configured": state.cfg.publish.is_some() }),
|
||||
Some(r) => json!({
|
||||
"state": if r.done_at.is_some() { "done" } else if suspended { "suspended" } else { "pending" },
|
||||
"state": if r.done_at.is_some() { "done" } else if waits.is_some() { "suspended" } else { "pending" },
|
||||
"waitsFor": waits.map(crate::publish::Wait::as_str),
|
||||
"configured": state.cfg.publish.is_some(),
|
||||
"since": r.created_at, "doneAt": r.done_at, "commit": r.commit_sha,
|
||||
"attempts": r.attempts, "error": r.last_error.map(|_| "retrying"),
|
||||
|
||||
Reference in New Issue
Block a user