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 ofrun. - 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.