scheduled_service
final class scheduled_service
| internal |
High-level service for managing scheduled tasks.
This service centralizes all business logic related to scheduled tasks, and provides a clean API for modules, extensions and facades.
Methods
List all scheduled tasks in the system.
Get a specific scheduled task.
Check if a task exists.
Reset scheduled tasks for a component to their defaults.
List all scheduled tasks for a component only.
Get the next scheduled task that will run after a timestamp.
Determine if a scheduled task is overdue.
Force run a scheduled task via CLI.
List scheduled tasks that are overdue.
List tasks that are disabled.
List tasks that were modified by config overrides.
Details
at line 39
__construct(task_support $task_wrapper)
Constructor.
at line 52
array
list()
List all scheduled tasks in the system.
at line 62
scheduled_task_dto
get(string $classname)
Get a specific scheduled task.
at line 76
bool
exists(string $classname)
Check if a task exists.
at line 90
void
reset_component(string $component)
Reset scheduled tasks for a component to their defaults.
This is useful when deploying new versions of plugins that modify db/tasks.php.
at line 100
array
list_by_component(string $component)
List all scheduled tasks for a component only.
at line 115
scheduled_task_dto|null
next(int $timestamp)
Get the next scheduled task that will run after a timestamp.
at line 123
bool
is_overdue(scheduled_task_dto $task, int|null $now = null)
Determine if a scheduled task is overdue.
at line 133
bool
is_customized(scheduled_task_dto $task)
Determine if a scheduled task is customized/overridden.
at line 143
bool
run_now(string $classname)
Force run a scheduled task via CLI.
Useful for admin screens or automation panels.
at line 164
array
list_overdue(int|null $now = null)
List scheduled tasks that are overdue.
at line 179
array
list_disabled()
List tasks that are disabled.
at line 192
array
list_customized()
List tasks that were modified by config overrides.