@@ -23,9 +23,10 @@ public function _construct()
23
23
}
24
24
25
25
/**
26
- * If job is currently in $currentStatus, set it to $newStatus
27
- * and return true. Otherwise, return false and do not change the job.
28
- * This method is used to implement locking for cron jobs.
26
+ * Sets new schedule status only if it's in the expected current status.
27
+ *
28
+ * If schedule is currently in $currentStatus, set it to $newStatus and
29
+ * return true. Otherwise, return false.
29
30
*
30
31
* @param string $scheduleId
31
32
* @param string $newStatus
@@ -47,11 +48,12 @@ public function trySetJobStatusAtomic($scheduleId, $newStatus, $currentStatus)
47
48
}
48
49
49
50
/**
50
- * If job is currently in $currentStatus and there are no existing jobs
51
- * with $newStatus, set it to $newStatus and return true. Otherwise,
52
- * return false and do not change the job.
53
- * This method is used to implement locking for cron jobs that share a
54
- * job code.
51
+ * Sets schedule status only if no existing schedules with the same job code
52
+ * have that status. This is used to implement locking for cron jobs.
53
+ *
54
+ * If the schedule is currently in $currentStatus and there are no existing
55
+ * schedules with the same job code and $newStatus, set the schedule to
56
+ * $newStatus and return true. Otherwise, return false.
55
57
*
56
58
* @param string $scheduleId
57
59
* @param string $newStatus
0 commit comments