fix(worker): mark ingested assets ready
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled
Deploy / Deploy Production (push) Failing after 2042h9m39s
Deploy / Build Production Runtime Images (push) Failing after 2042h18m31s

This commit is contained in:
Xiaoxia AI
2026-06-23 13:12:17 +08:00
parent 176914b3a4
commit 93d212c1c4
2 changed files with 15 additions and 1 deletions
+6 -1
View File
@@ -7,7 +7,7 @@ from packages.adapters.sqlalchemy_impl import (
SQLAlchemyAssetRepository,
SQLAlchemyIngestJobRepository,
)
from packages.domain import Asset, IngestJobStatus
from packages.domain import Asset, AssetStatus, IngestJobStatus
from worker_app.core.asset_types import infer_mime_type_from_storage_key
@@ -56,6 +56,11 @@ def ingest_asset(job_id: str) -> dict:
storage_key=job.storage_key,
mime_type=mime_type,
metadata=metadata,
file_size=int(metadata["size_bytes"]),
duration=float(metadata["duration"]),
width=int(metadata["width"]),
height=int(metadata["height"]),
status=AssetStatus.READY,
)
asset_repo.create(asset)
+9
View File
@@ -0,0 +1,9 @@
from pathlib import Path
def test_ingest_marks_created_assets_ready_with_size_metadata():
source = Path("apps/worker/worker_app/tasks/ingest.py").read_text(encoding="utf-8")
assert "status=AssetStatus.READY" in source
assert "file_size=int(metadata[\"size_bytes\"])" in source
assert "duration=float(metadata[\"duration\"])" in source