From 360abf4b69b7e10bd99914aad12ac34ff6408698 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 8 May 2024 21:16:27 +1200 Subject: [PATCH] Return from create attribute job is unable to find it in the attributes table --- src/Appwrite/Platform/Workers/Databases.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Workers/Databases.php b/src/Appwrite/Platform/Workers/Databases.php index 6510461eee..56f5f012e8 100644 --- a/src/Appwrite/Platform/Workers/Databases.php +++ b/src/Appwrite/Platform/Workers/Databases.php @@ -116,6 +116,11 @@ class Databases extends Action */ $attribute = $dbForProject->getDocument('attributes', $attribute->getId()); + if ($attribute->isEmpty()) { + // Attribute was deleted before job was processed + return; + } + $collectionId = $collection->getId(); $key = $attribute->getAttribute('key', ''); $type = $attribute->getAttribute('type', ''); @@ -176,7 +181,6 @@ class Databases extends Action } } - $dbForProject->updateDocument( 'attributes', $attribute->getId(),