Skip to content

Commit 414777c

Browse files
committed
Add $task_key property to the sTask::schedule method to more easily set that [#40]
Merge remote-tracking branch 'upstream/pr/40'
2 parents ed14651 + ed57c06 commit 414777c

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

core/components/scheduler/docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Scheduler 1.9.0-pl
22
------------------
33
Released on 2026-01-22
44

5+
- Add $task_key property to the sTask::schedule method to more easily set that [#40]
56
- Add recurring tasks support: tasks can automatically reschedule after successful execution
67
- Add `scheduleNext()` method to sTask for automatic rescheduling
78
- Fix race condition in run.php with atomic status update

core/components/scheduler/model/scheduler/stask.class.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@ class sTask extends xPDOSimpleObject
2020
* @param array $data
2121
* @return false|sTaskRun
2222
*/
23-
public function schedule($when, array $data = array()) {
24-
23+
public function schedule($when, array $data = array(), string $task_key = '')
24+
{
2525
/** @var sTaskRun $run */
2626
$run = $this->xpdo->newObject('sTaskRun');
2727
$run->fromArray(array(
2828
'task' => $this->get('id'),
2929
'data' => $data,
30+
'task_key' => $task_key,
3031
));
3132
$run->setTiming($when);
3233

0 commit comments

Comments
 (0)