Skip to main content

run_staged

Function run_staged 

Source
pub async fn run_staged(
    pool: &PgPool,
    vault: &Vault,
    actor: &Actor,
    id: Uuid,
) -> AppResult<ImportResult>
Expand description

Runs a staged import and removes the upload (a second click finds nothing).

§Invariants

  • Permission: as run; the staged upload must belong to the actor (otherwise “not found”, like a used or expired one).
  • Locks: the staged row (FOR UPDATE), then those of run.
  • Audit / notifications / webhooks: as run.
  • Atomic: one transaction: the import and the removal of the staged upload commit together, so a second click finds nothing.