1
0
Fork 0
mirror of synced 2024-06-01 18:39:57 +12:00

Merge pull request #4517 from appwrite/v1-fix-usage-projects-pagination

V1: Fix: DB Usage projects pagination
This commit is contained in:
Eldad A. Fux 2022-10-18 14:39:56 +03:00 committed by GitHub
commit 28252f693b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,7 @@
# Version 1.0.4
- Fix project pagination in DB usage collector [#4517](https://github.com/appwrite/appwrite/pull/4517)
# Version 1.0.3
## Bugs
- Fix document audit deletion [#4429](https://github.com/appwrite/appwrite/pull/4429)

View file

@ -132,7 +132,6 @@ class Database extends Calculator
$results = [];
$sum = $limit;
$latestDocument = null;
$this->database->setNamespace('_' . $projectId);
while ($sum === $limit) {
try {
@ -140,6 +139,8 @@ class Database extends Calculator
if ($latestDocument !== null) {
$paginationQueries[] = Query::cursorAfter($latestDocument);
}
$this->database->setNamespace('_' . $projectId);
$results = $this->database->find($collection, \array_merge($paginationQueries, $queries));
} catch (\Exception $e) {
if (is_callable($this->errorHandler)) {