mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Remove purgeCachedCollection
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user