Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

162
Vistas
Add job inside another job for APSchedule

I am using APScheduler in a FastAPI application. I have a table, where I stored my async tasks. Then, using APScheduler, I would like to read this table every hour and add new jobs (one per row of the table) to the queue. These jobs are light, so using celery is overkilling I feel. However, I have difficulty in starting a job inside another job for APScheduler. So, the question is how a job can be added inside another job? Any ideas or help are appreciated.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I've also had a problem with this and a simple solution is to have the scheduler as a global variable available in the job's module. You might also have to use the memory store, as it allows for passing unserializable objects.

You can also pass the scheduler to the job, as long as the job is being run on an executor that doesn't require the arguments to be serialized.

For example, you can have a periodic job running on the asyncio executor that gets the scheduler as an argument, and adds further jobs to it, that are to be run with the ProcessPool executor.

For more info, refer to this discussion in the Gitter channel

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda