// this can happen if the function runs multiple times simultaneously
// we just care that the task is registered afterward so we can safely ignore the error
} } /**
* @return array<string, mixed>
*/
private function getUpdatePayload(ScheduledTaskEntity
$registeredTask, ScheduledTask
$task): array
{ $payload =
[];
if (!
$task->
shouldRun($this->parameterBag
) && \
in_array($registeredTask->
getStatus(),
[ScheduledTaskDefinition::STATUS_QUEUED, ScheduledTaskDefinition::STATUS_SCHEDULED
], true
)) { $payload['status'
] = ScheduledTaskDefinition::STATUS_SKIPPED;
} if ($task->
shouldRun($this->parameterBag
) && \
in_array($registeredTask->
getStatus(),
[ScheduledTaskDefinition::STATUS_QUEUED, ScheduledTaskDefinition::STATUS_SKIPPED
], true
)) { $payload['status'
] = ScheduledTaskDefinition::STATUS_SCHEDULED;
$payload['nextExecutionTime'
] =
$this->
calculateNextExecutionTime($registeredTask);
} if ($task->
getDefaultInterval() !==
$registeredTask->
getDefaultRunInterval()) { // default run interval changed
$payload['defaultRunInterval'
] =
$task->
getDefaultInterval();