diff --git a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php index 7540b74759..6adfcacab4 100644 --- a/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php +++ b/src/Appwrite/Platform/Modules/Functions/Workers/Screenshots.php @@ -237,6 +237,7 @@ class Screenshots extends Action $updates->setAttribute($key, $fileId); } + $date = \date('H:i:s'); $this->appendToLogs($dbForProject, $deployment->getId(), $queueForRealtime, "[$date] [appwrite] Screenshot capturing finished. \n"); // Apply screenshot properties @@ -257,39 +258,8 @@ class Screenshots extends Action $date = \date('H:i:s'); $this->appendToLogs($dbForProject, $deployment->getId(), $queueForRealtime, "[$date] [appwrite] Screenshot capturing failed. Deployment will continue. \n"); - } finally { - // Fill failure screenshots if not successful - - if (\is_null($deployment) || $deployment->isEmpty()) { - return; - } - - if (\is_null($site) || $site->isEmpty()) { - return; - } - - $updates = new Document(); - - if (empty($deployment->getAttribute('screenshotDark', ''))) { - $updates->setAttribute('screenshotDark', '/console/images/sites/screenshot-placeholder-dark.svg'); - } - if (empty($deployment->getAttribute('screenshotLight', ''))) { - $updates->setAttribute('screenshotLight', '/console/images/sites/screenshot-placeholder-light.svg'); - } - - if (!$updates->isEmpty()) { - // Apply screenshot properties - $deployment = $dbForProject->updateDocument('deployments', $deployment->getId(), $updates); - - $queueForRealtime - ->setPayload($deployment->getArrayCopy()) - ->trigger(); - - $site = $dbForProject->updateDocument('sites', $site->getId(), new Document([ - 'deploymentScreenshotDark' => $deployment->getAttribute('screenshotDark', ''), - 'deploymentScreenshotLight' => $deployment->getAttribute('screenshotLight', ''), - ])); - } + + throw $th; } }