From 71f2c6c1316eb041269409bc591ff5bc2201eaeb Mon Sep 17 00:00:00 2001 From: fogelito Date: Wed, 13 Nov 2024 14:55:56 +0200 Subject: [PATCH] Remove purgeCachedCollection --- app/controllers/api/databases.php | 12 ------------ src/Appwrite/Platform/Workers/Databases.php | 2 -- 2 files changed, 14 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 6af4f592d6..523529698d 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -396,8 +396,6 @@ function updateAttribute( } } - $purge = false; - if (!empty($newKey) && $key !== $newKey) { $originalUid = $attribute->getId(); @@ -417,15 +415,10 @@ function updateAttribute( $attributes = $index->getAttribute('attributes', []); $found = \array_search($key, $attributes); - var_dump($attributes); - var_dump('found==='); - var_dump($found); - if ($found !== false) { $attributes[$found] = $newKey; $index->setAttribute('attributes', $attributes); $dbForProject->updateDocument('indexes', $index->getId(), $index); - $purge = true; } } } else { @@ -434,11 +427,6 @@ function updateAttribute( $dbForProject->purgeCachedDocument('database_' . $db->getInternalId(), $collection->getId()); - if($purge){ - // I think we are missing this? - $dbForProject->purgeCachedCollection('database_' . $db->getInternalId() . '_collection_' . $collection->getInternalId()); - } - $queueForEvents ->setContext('collection', $collection) ->setContext('database', $db) diff --git a/src/Appwrite/Platform/Workers/Databases.php b/src/Appwrite/Platform/Workers/Databases.php index f697e7be13..1cbc3a3f8b 100644 --- a/src/Appwrite/Platform/Workers/Databases.php +++ b/src/Appwrite/Platform/Workers/Databases.php @@ -350,11 +350,9 @@ class Databases extends Action } $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $collectionId); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId()); if (!$relatedCollection->isEmpty() && !$relatedAttribute->isEmpty()) { $dbForProject->purgeCachedDocument('database_' . $database->getInternalId(), $relatedCollection->getId()); - $dbForProject->purgeCachedCollection('database_' . $database->getInternalId() . '_collection_' . $relatedCollection->getInternalId()); } }