This commit is contained in:
2026-03-18 18:16:44 +01:00
parent c89c08c397
commit b3c8b77f12
20 changed files with 1934 additions and 36 deletions
+5 -2
View File
@@ -24,7 +24,9 @@ from arq.connections import RedisSettings
from app.config import get_settings
from app.imap.pool import MailboxPool
from app.jobs.send_pec import send_pec
from app.jobs.sync_mailbox import sync_mailbox
from app.smtp.receipt_watcher import watch_receipt
from app.storage.minio_client import ensure_bucket_exists
settings = get_settings()
@@ -127,7 +129,7 @@ class WorkerSettings:
"""Configurazione del worker arq."""
# Funzioni/job registrati
functions = [sync_mailbox, health_check]
functions = [sync_mailbox, send_pec, watch_receipt, health_check]
# Callbacks lifecycle
on_startup = on_startup
@@ -140,7 +142,8 @@ class WorkerSettings:
max_jobs = 20
# Timeout per ogni job (secondi)
job_timeout = 300
# send_pec può richiedere più tempo su SMTP lenti
job_timeout = 120
# Retry automatico in caso di errore
max_tries = 3