fix: the media backup task has its own stall threshold, and its test seeds a post for a shared archive
CI and images / lint (push) Successful in 2s
CI and images / extension-version (push) Successful in 3s
CI and images / extension-test (push) Successful in 23s
CI and images / frontend-build (push) Successful in 27s
CI and images / backend-lint-and-test (push) Successful in 47s
CI and images / integration (push) Successful in 2m25s
CI and images / sign-extension (push) Successful in 2s
CI and images / build-agent (push) Successful in 5s
CI and images / build-web (push) Successful in 2m12s
CI and images / smoke-web (push) Successful in 50s
CI and images / promote (push) Successful in 2s
CI and images / refresh-dev (push) Skipped
CI and images / unattended-failure (push) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-06 22:15:26 -05:00
co-authored by Claude Opus 5.5
parent 0cf8edaa10
commit d465198c4a
2 changed files with 20 additions and 3 deletions
+3
View File
@@ -173,6 +173,9 @@ TASK_STUCK_THRESHOLD_MINUTES: dict[str, int] = {
# legitimately-running backup isn't flagged. # legitimately-running backup isn't flagged.
"backend.app.tasks.backup.backup_images_task": 420, "backend.app.tasks.backup.backup_images_task": 420,
"backend.app.tasks.backup.restore_images_task": 420, "backend.app.tasks.backup.restore_images_task": 420,
# One media-backup chunk stops starting files after 45 min but may finish
# a large file in flight, up to its 6.5 h hard limit.
"backend.app.tasks.backup.backup_media_task": 420,
# Library audit scans the full library — 2h hard limit. # Library audit scans the full library — 2h hard limit.
"backend.app.tasks.library_audit.scan_library_for_rule": 130, "backend.app.tasks.library_audit.scan_library_for_rule": 130,
# External file-host fetches (mega/gdrive/film packs) can run to the task's # External file-host fetches (mega/gdrive/film packs) can run to the task's
+17 -3
View File
@@ -7,7 +7,14 @@ from datetime import UTC, datetime, timedelta
import pytest import pytest
from sqlalchemy import select from sqlalchemy import select
from backend.app.models import BackupBlob, BackupRun, ImageRecord, PostAttachment from backend.app.models import (
Artist,
BackupBlob,
BackupRun,
ImageRecord,
Post,
PostAttachment,
)
from backend.app.services import backup_media from backend.app.services import backup_media
from backend.app.services.backup_s3 import ListPage, S3Error, S3Target, StoredObject from backend.app.services.backup_s3 import ListPage, S3Error, S3Target, StoredObject
@@ -51,8 +58,15 @@ def test_the_work_list_is_every_file_once_that_the_bucket_lacks(db_sync, tmp_pat
_image(db_sync, tmp_path, "a") _image(db_sync, tmp_path, "a")
_image(db_sync, tmp_path, "b") _image(db_sync, tmp_path, "b")
_attachment(db_sync, tmp_path, "c") _attachment(db_sync, tmp_path, "c")
# The same archive held by a second post is one file to send. # The same archive held by a post as well is one file to send.
db_sync.add(PostAttachment(sha256=_sha("c"), path=str(tmp_path / "c-copy.zip"), artist = Artist(name="Bea", slug="bea")
db_sync.add(artist)
db_sync.flush()
post = Post(artist_id=artist.id, external_post_id="p1")
db_sync.add(post)
db_sync.flush()
db_sync.add(PostAttachment(post_id=post.id, sha256=_sha("c"),
path=str(tmp_path / "c-copy.zip"),
original_filename="set.zip", ext=".zip", size_bytes=3)) original_filename="set.zip", ext=".zip", size_bytes=3))
db_sync.add(BackupBlob(target=TID, sha256=_sha("b"), key="media/bb", size_bytes=3)) db_sync.add(BackupBlob(target=TID, sha256=_sha("b"), key="media/bb", size_bytes=3))
# A row for another bucket doesn't count for this one. # A row for another bucket doesn't count for this one.