Skip to main content

rescan_references

Function rescan_references 

Source
pub async fn rescan_references(
    pool: &PgPool,
    vault: &Vault,
    formats: &[String],
) -> AppResult<u64>
Expand description

Reads the references of the current file versions of the given formats again and replaces the stored ones – after a reader improved (e.g. SOLIDWORKS 2015+ files, whose compressed sections were not read before). Formats that are not scanned for references are skipped. Each version is replaced in its own transaction, so an interrupted run can simply be repeated. Returns how many versions were scanned.

§Invariants

  • Permission: none (maintenance task of the server, no actor).
  • Locks: the file version row (FOR UPDATE) while its references are replaced.
  • Audit / notifications / webhooks: none.
  • Atomic: one transaction per version (delete of the old references and insert of the new ones go together).