remove the hardcoded throw Timeout Exception;

This commit is contained in:
fogelito
2023-01-16 08:32:47 +02:00
parent 3c5b14abe7
commit 40bd8d54e5
2 changed files with 8 additions and 5 deletions
+4 -3
View File
@@ -179,6 +179,9 @@ App::error()
->inject('request')
->inject('dbForProject')
->action(function (App $utopia, throwable $error, Request $request, Database $dbForProject) {
var_dump("App::error");
var_dump("getCode=" . $error->getCode());
var_dump($error->getMessage());
if ($error instanceof Timeout) {
var_dump("App::error() in in in in in in in in in in in in in");
var_dump($request->getParams());
@@ -2102,7 +2105,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
}
$filterQueries = Query::groupByType($queries)['filters'];
$timeoutMilliseconds = 200;
$timeoutMilliseconds = 200; // todo: make this configurable
if ($documentSecurity && !$valid) {
$documents = $dbForProject->find('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $queries, $timeoutMilliseconds);
@@ -2112,8 +2115,6 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
$total = Authorization::skip(fn () => $dbForProject->count('database_' . $database->getInternalId() . '_collection_' . $collection->getInternalId(), $filterQueries, APP_LIMIT_COUNT));
}
throw new Timeout('Timeout'); // Force Exception.....
/**
* Reset $collection attribute to remove prefix.
*/
@@ -995,11 +995,13 @@ trait DatabasesBase
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'queries' => ['orderAsc("releaseYear")', 'sleep(1)'],
'queries' => ['sleep("$id", 1)'],
]);
die;
var_dump($documents);
die;
$documents = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $data['moviesId'] . '/documents', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],