Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!