mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
.env variables for slow queries
This commit is contained in:
@@ -84,6 +84,9 @@ _APP_LOGGING_CONFIG=
|
||||
_APP_GRAPHQL_MAX_BATCH_SIZE=10
|
||||
_APP_GRAPHQL_MAX_COMPLEXITY=250
|
||||
_APP_GRAPHQL_MAX_DEPTH=3
|
||||
_APP_SLOW_QUERIES_MAX_HITS=2
|
||||
_APP_SLOW_QUERIES_TIMEOUT=200
|
||||
_APP_SLOW_QUERIES=1
|
||||
DOCKERHUB_PULL_USERNAME=
|
||||
DOCKERHUB_PULL_PASSWORD=
|
||||
DOCKERHUB_PULL_EMAIL=
|
||||
@@ -213,7 +213,7 @@ App::error()
|
||||
])));
|
||||
} else {
|
||||
$document['count']++;
|
||||
$max = App::getEnv('_APP_SLOW_QUERIES_MAX_HITS', 2); // todo: set default value
|
||||
$max = App::getEnv('_APP_SLOW_QUERIES_MAX_HITS', 99999); // todo: set default value
|
||||
if ($document['count'] > $max) {
|
||||
$document['blocked'] = true;
|
||||
}
|
||||
@@ -2119,7 +2119,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
}
|
||||
|
||||
$filterQueries = Query::groupByType($queries)['filters'];
|
||||
$timeout = 200; // todo: make this configurable
|
||||
$timeout = App::getEnv('_APP_SLOW_QUERIES') === '1' ? App::getEnv('_APP_SLOW_QUERIES_TIMEOUT') : null;
|
||||
|
||||
if ($documentSecurity && !$valid) {
|
||||
$documents = $dbForProject->find('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, $timeout);
|
||||
|
||||
Reference in New Issue
Block a user