ejecución
This commit is contained in:
@ -16,12 +16,13 @@ scheduler.add_job(search_from_keywords_file, "cron", hour=1, minute=0) #Ejecutar
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
enviar_resumen_diario()
|
||||
scheduler.start()
|
||||
yield
|
||||
scheduler.shutdown()
|
||||
|
||||
# Inicializar FastAPI con lifespan
|
||||
app = FastAPI(lifespan=lifespan, on_startup=[enviar_resumen_diario])
|
||||
app = FastAPI(lifespan=lifespan)
|
||||
|
||||
# Incluir rutas
|
||||
app.include_router(router)
|
||||
|
Reference in New Issue
Block a user