Merge branch 'dev' into chore/code-hygiene

This commit is contained in:
npeter83 2026-07-11 16:22:39 +02:00
commit aee1bdc85d
4 changed files with 38 additions and 11 deletions

View file

@ -60,6 +60,14 @@ def get_or_create_asset(
)
asset = db.execute(stmt).scalar_one_or_none()
if asset is not None:
# A previously-FAILED shared asset must be re-attempted for the new job about to hold it —
# reset it to pending (+clear the error) so the worker actually re-downloads instead of
# short-circuiting the new job with the asset's stale error. (Mirrors resume_download; without
# this a fresh enqueue of a once-failed (source,format) pair is permanently poisoned, since
# errored assets carry no expires_at and GC never clears them.)
if asset.status == "error":
asset.status = "pending"
asset.error = None
return asset
asset = MediaAsset(
source_kind=source_kind,