Reputation: 107
I need to store all jobs for apscheduler in my mysql db, so apscheduler should every 5 minutes check, if there r some new jobs and start them, or delete, if some job were deleted from db. The problem is, that i can't understand, how would be better to store jobs (for example, some jobs may be cron and some may be with interval trigger, so they will have different time settings). As i understood, apscheduler supports storing jobs in job stores and has SQLAlchemyJobStore. On every documentation there r only examples, where apscheduler will store its jobs in db. But i need it to grab jobs from my db. The question is, is there a way to store jobs in db, so apscheduler will easily grab them, and there will be no need for me to create 20 columns in my table for job_name, trigger, start_date etc?
Upvotes: 0
Views: 2121
Reputation: 5911
Instead of manually inserting rows to the table, you should consider making the scheduler available over some RPC service. An example of this can be found here. This will abstract away the implementation details and is a bit more future proof.
Upvotes: 2