refactor cache for variables

This commit is contained in:
Everly Precia Suresh
2022-12-07 14:58:11 +00:00
parent ef77f0cd59
commit e3dbbba6c4
2 changed files with 1 additions and 4 deletions
-4
View File
@@ -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();
});
+1
View File
@@ -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()]),