Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

161
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda