refactor: Substitui APScheduler por asyncio nativo para OCP

- Remove dependência apscheduler
- Implementa loop asyncio com sleep calculado
- Compatível com ambientes sem cron (OCP/Kubernetes)
- Documenta solução em SCHEDULER.md
This commit is contained in:
Frederico Castro
2025-12-10 01:55:55 -03:00
parent 3ea6a4409e
commit c6aaf66e87
4 changed files with 112 additions and 35 deletions

View File

@@ -20,8 +20,7 @@ async def lifespan(app: FastAPI):
try:
job = get_processar_job()
scheduler = RankingScheduler(job)
scheduler.iniciar()
print("Scheduler do ranking iniciado: job rodará diariamente às 3h")
await scheduler.iniciar()
except Exception as e:
print(f"AVISO: Scheduler não iniciou: {e}")