mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
refactor cache for variables
This commit is contained in:
@@ -1374,7 +1374,6 @@ App::post('/v1/functions/:functionId/variables')
|
||||
throw new Exception(Exception::VARIABLE_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
$dbForProject->deleteCachedDocument('functions', $function->getId());
|
||||
|
||||
$response
|
||||
->setStatusCode(Response::STATUS_CODE_CREATED)
|
||||
@@ -1490,8 +1489,6 @@ App::put('/v1/functions/:functionId/variables/:variableId')
|
||||
throw new Exception(Exception::VARIABLE_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
$dbForProject->deleteCachedDocument('functions', $function->getId());
|
||||
|
||||
$response->dynamic($variable, Response::MODEL_VARIABLE);
|
||||
});
|
||||
|
||||
@@ -1528,7 +1525,6 @@ App::delete('/v1/functions/:functionId/variables/:variableId')
|
||||
}
|
||||
|
||||
$dbForProject->deleteDocument('variables', $variable->getId());
|
||||
$dbForProject->deleteCachedDocument('functions', $function->getId());
|
||||
|
||||
$response->noContent();
|
||||
});
|
||||
|
||||
@@ -411,6 +411,7 @@ Database::addFilter(
|
||||
return null;
|
||||
},
|
||||
function (mixed $value, Document $document, Database $database) {
|
||||
$database->deleteCachedDocument('functions', $document->getId());
|
||||
return $database
|
||||
->find('variables', [
|
||||
Query::equal('functionInternalId', [$document->getInternalId()]),
|
||||
|
||||
Reference in New Issue
Block a user