MDL-46207 Tasks: Do not run tasks if their component is disabled.
This can be overridden on a per task basis by implementing: get_run_if_component_disabled() in the scheduled task.
This commit is contained in:
@@ -183,6 +183,15 @@ abstract class scheduled_task extends task_base {
|
||||
return $this->disabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Override this function if you want this scheduled task to run, even if the component is disabled.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function get_run_if_component_disabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Take a cron field definition and return an array of valid numbers with the range min-max.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user