ppt-tool/backend/workers/main.py
Vadym Samoilenko c97841f6d1 Phase 6: Export & Polish — brand export, client dashboard, retention, analytics
- Brand-enforced export pipeline (PPTX/PDF with auto brand fonts/colors/logo)
- Client library dashboard with two-level navigation (client grid → detail tabs)
- Data retention service with ARQ cron jobs (daily cleanup + weekly purge)
- Brand-adaptive UI theme via CSS custom properties (dynamic per client)
- Analytics dashboard with overview, usage, quality, and performance metrics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 16:41:58 +00:00

30 lines
961 B
Python

"""ARQ worker entry point.
Run with: python -m arq workers.main.WorkerSettings
"""
import os
from arq.connections import RedisSettings
from arq.cron import cron
from workers.master_deck_worker import parse_master_deck_task
from workers.presentation_worker import generate_presentation_task
from workers.retention_worker import retention_cleanup_task, retention_purge_task
def _get_redis_settings() -> RedisSettings:
url = os.environ.get("REDIS_URL", "redis://localhost:6379/0")
return RedisSettings.from_dsn(url)
class WorkerSettings:
redis_settings = _get_redis_settings()
functions = [generate_presentation_task, parse_master_deck_task]
cron_jobs = [
cron(retention_cleanup_task, hour=2, minute=0), # Daily at 2:00 AM
cron(retention_purge_task, weekday=0, hour=3, minute=0), # Weekly Monday 3:00 AM
]
max_jobs = 5
job_timeout = 600 # 10 minutes
max_tries = 3
health_check_interval = 30