Skip to content

Helper to download latest corpus export

This download_latest_export helper will be written in a new CorpusMixin. Workflow is:

  • call ListExports endpoint with self.corpus_id
  • Find the latest that is in "done" state (we should have an enum listing CorpusExportStates, between "created" "running" "failed" "done")
  • If no export, crash saying that you should first run an export of the corpus.
  • If there is one, call DownloadExport with the export's ID. This will download the export in a temporary file.
  • Return the path to that export.

Refs https://redmine.teklia.com/issues/7549