upload files without API-Key

This commit is contained in:
sriram
2026-08-28 17:13:31 +05:30
parent 52f5d3be1d
commit 5aa2669f7d
9 changed files with 1396 additions and 90 deletions

View File

@@ -94,6 +94,20 @@ async def lifespan(_app: FastAPI):
interrupted = scan_interrupted()
if interrupted:
logger.info("Marked %d interrupted catalog batch(es).", len(interrupted))
# Retention, which otherwise only runs when the ingestion worker goes
# idle. That was sufficient while every upload was queued work; it is
# not now that /api/uploads/catalog stages drops for review and queues
# nothing. An inbox nobody acts on would never start the worker, so the
# sweep that reclaims abandoned uploads would never run either.
try:
from app.core.batch_ingest import purge_expired
purged = purge_expired()
if purged:
logger.info("Purged %d expired batch upload(s) at startup.", len(purged))
except Exception as exc: # noqa: BLE001 - housekeeping must not block boot
logger.warning("Could not purge expired batch uploads: %s", exc)
if interrupted and BATCH_AUTO_RESUME:
# Opt-in only. Importing the worker here rather than at module
# scope keeps the queue and its thread out of a boot that never