Remove code from worker

This commit is contained in:
fogelito 2025-01-16 17:22:53 +02:00
parent 0afbfe2f84
commit 1b4a96b1fb

View file

@ -11,7 +11,6 @@ use Utopia\Database\Document;
use Utopia\Database\Exception as DatabaseException;
use Utopia\Database\Exception\Authorization;
use Utopia\Database\Exception\Conflict;
use Utopia\Database\Exception\Dependency;
use Utopia\Database\Exception\NotFound;
use Utopia\Database\Exception\Restricted;
use Utopia\Database\Exception\Structure;
@ -293,18 +292,16 @@ class Databases extends Action
if ($e instanceof DatabaseException) {
$attribute->setAttribute('error', $e->getMessage());
if (! $relatedAttribute->isEmpty()) {
if (!$relatedAttribute->isEmpty()) {
$relatedAttribute->setAttribute('error', $e->getMessage());
}
}
$dbForProject->updateDocument(
'attributes',
$attribute->getId(),
$attribute->setAttribute('status', 'stuck')
);
if (! $relatedAttribute->isEmpty()) {
if (!$relatedAttribute->isEmpty()) {
$dbForProject->updateDocument(
'attributes',
$relatedAttribute->getId(),
@ -312,10 +309,6 @@ class Databases extends Action
);
}
if ($e instanceof Dependency) {
return;
}
throw $e;
} finally {
$this->trigger($database, $collection, $attribute, $project, $projectId, $events);