Removed null check for scheduleId
This commit is contained in:
parent
78a224be14
commit
74c97a833c
1 changed files with 6 additions and 9 deletions
|
@ -450,15 +450,12 @@ class BuildsV1 extends Worker
|
|||
/** Update function schedule */
|
||||
$dbForConsole = $this->getConsoleDB();
|
||||
// Inform scheduler if function is still active
|
||||
$scheduleId = $function->getAttribute('scheduleId', '');
|
||||
if (!empty($scheduleId)) {
|
||||
$schedule = $dbForConsole->getDocument('schedules', $scheduleId);
|
||||
$schedule
|
||||
->setAttribute('resourceUpdatedAt', DateTime::now())
|
||||
->setAttribute('schedule', $function->getAttribute('schedule'))
|
||||
->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment')));
|
||||
Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule));
|
||||
}
|
||||
$schedule = $dbForConsole->getDocument('schedules', $function->getAttribute('scheduleId'));
|
||||
$schedule
|
||||
->setAttribute('resourceUpdatedAt', DateTime::now())
|
||||
->setAttribute('schedule', $function->getAttribute('schedule'))
|
||||
->setAttribute('active', !empty($function->getAttribute('schedule')) && !empty($function->getAttribute('deployment')));
|
||||
Authorization::skip(fn () => $dbForConsole->updateDocument('schedules', $schedule->getId(), $schedule));
|
||||
} catch (\Throwable $th) {
|
||||
$endTime = DateTime::now();
|
||||
$durationEnd = \microtime(true);
|
||||
|
|
Loading…
Reference in a new issue