upload files without API-Key
This commit is contained in:
14
app/main.py
14
app/main.py
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user