Upgrade configuration and Docker stack to v2.0.0

This commit is contained in:
2026-06-22 14:49:56 -04:00
parent 2f2a5e9b4a
commit 0d2ecbd218
19 changed files with 779 additions and 495 deletions
+26 -9
View File
@@ -1,19 +1,36 @@
#!/usr/bin/env python3
"""
Entrypoint du worker ARQ — traitement des images en arrière-plan.
Worker ARQ — lancement du worker de traitement asynchrone.
Lancer avec : python worker.py
Usage:
python worker.py
# ou via arq directement :
# arq app.workers.image_worker.WorkerSettings
Le worker écoute les queues Redis 'standard' et 'premium' et traite
les tâches de pipeline image (EXIF → OCR → AI).
Le worker écoute la file Redis et traite les images uploadées
via le pipeline EXIF → OCR → Vision AI.
"""
import asyncio
import logging
import sys
from pathlib import Path
# Ajouter le répertoire parent au PYTHONPATH pour les imports relatifs
sys.path.insert(0, str(Path(__file__).resolve().parent))
from arq import run_worker
from app.config import settings
from app.logging_config import configure_logging
from app.config import settings
from app.workers.image_worker import WorkerSettings
# Configure le logging dès l'import
configure_logging(debug=settings.DEBUG)
if __name__ == "__main__" :
def main():
configure_logging(debug=settings.DEBUG)
logger = logging.getLogger("worker")
logger.info("Starting Imago worker on queue '%s'", WorkerSettings.queue_name)
run_worker(WorkerSettings)
if __name__ == "__main__":
main()