|
ORE Studio 0.0.4
|
Coordinator for OreStudio in-process job scheduling. More...
#include <cron_scheduler.hpp>

Public Types | |
| using | context = ores::database::context |
Public Member Functions | |
| cron_scheduler (context ctx) | |
| domain::job_definition | schedule (domain::job_definition def, const std::string &change_reason_code, const std::string &change_commentary) |
| Persist a job definition and mark it as active. | |
| void | unschedule (const boost::uuids::uuid &job_definition_id, const std::string &modified_by, const std::string &change_reason_code, const std::string &change_commentary) |
| Mark a job as inactive (paused). | |
| std::vector< domain::job_definition > | get_all_definitions () |
| All job definitions visible to the current tenant+party context. | |
| std::vector< domain::job_instance > | get_job_history (const boost::uuids::uuid &job_definition_id, std::size_t limit=100) |
| Execution history for a specific job, newest-first. | |
Coordinator for OreStudio in-process job scheduling.
Provides CRUD operations for job definitions and access to job execution history. The actual scheduling is performed by scheduler_loop; this class handles the management plane only.
Lifecycle:
Thread safety: not thread-safe. Each request should create its own instance (or use a per-request database context).
| domain::job_definition schedule | ( | domain::job_definition | def, |
| const std::string & | change_reason_code, | ||
| const std::string & | change_commentary | ||
| ) |
Persist a job definition and mark it as active.
Writes the job_definition to ores_scheduler_job_definitions_tbl with is_active=true. The in-process scheduler_loop will pick it up on the next reload.
| void unschedule | ( | const boost::uuids::uuid & | job_definition_id, |
| const std::string & | modified_by, | ||
| const std::string & | change_reason_code, | ||
| const std::string & | change_commentary | ||
| ) |
Mark a job as inactive (paused).
Sets is_active=false on the current active record. The scheduler_loop will skip the job after the next reload.
| std::vector< domain::job_instance > get_job_history | ( | const boost::uuids::uuid & | job_definition_id, |
| std::size_t | limit = 100 |
||
| ) |
Execution history for a specific job, newest-first.
| limit | Maximum number of instances returned (default: 100). |