Use ContainerStatus::tryFrom in ProcessScheduleService (#1101)

This commit is contained in:
MartinOscar 2025-03-16 15:36:15 +01:00 committed by GitHub
parent 0051370f24
commit d452e3d2f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,7 +42,7 @@ class ProcessScheduleService
// Check that the server is currently in a starting or running state before executing // Check that the server is currently in a starting or running state before executing
// this schedule if this option has been set. // this schedule if this option has been set.
try { try {
$state = fluent($this->serverRepository->setServer($schedule->server)->getDetails())->get('state') ?? ContainerStatus::Offline; $state = ContainerStatus::tryFrom(fluent($this->serverRepository->setServer($schedule->server)->getDetails())->get('state')) ?? ContainerStatus::Offline;
// If the server is stopping or offline just do nothing with this task. // If the server is stopping or offline just do nothing with this task.
if ($state->isOffline()) { if ($state->isOffline()) {