Handle existing import WorkerRuns on process retry
Closes #1606 (closed)
This adds three queries when starting a IIIF, S3, Files or Transkribus process, and one query when retrying. This cannot be avoided until Django 5.0, even with the rewrite in #1585 (closed), where bulk_create
will support retrieving the IDs of existing items in one query, using an INSERT … ON CONFLICT DO UPDATE … RETURNING id
.