Merge branch 'dev' into chore/code-hygiene
This commit is contained in:
commit
aee1bdc85d
4 changed files with 38 additions and 11 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue