Remove purgeCachedCollection

This commit is contained in:
fogelito
2024-11-13 14:55:56 +02:00
parent bae6e465fa
commit 71f2c6c131
2 changed files with 0 additions and 14 deletions
-12
View File
@@ -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)
@@ -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());
}
}