mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Get tests passing
This commit is contained in:
parent
3a68c77406
commit
585ee4b88e
1 changed files with 8 additions and 1 deletions
|
|
@ -76,7 +76,11 @@ class UsageDump extends Action
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str_contains($key, METRIC_DATABASES_STORAGE)) {
|
if (str_contains($key, METRIC_DATABASES_STORAGE)) {
|
||||||
$this->handleDatabaseStorage($key, $dbForProject);
|
try {
|
||||||
|
$this->handleDatabaseStorage($key, $dbForProject);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
console::error('[' . DateTime::now() . '] failed to calculate database storage for key [' . $key . '] ' . $e->getMessage());
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -170,6 +174,7 @@ class UsageDump extends Action
|
||||||
switch (count($data)) {
|
switch (count($data)) {
|
||||||
// Collection Level
|
// Collection Level
|
||||||
case METRIC_COLLECTION_LEVEL_STORAGE:
|
case METRIC_COLLECTION_LEVEL_STORAGE:
|
||||||
|
Console::log('[' . DateTime::now() . '] Collection Level Storage Calculation [' . $key . ']');
|
||||||
$databaseInternalId = $data[0];
|
$databaseInternalId = $data[0];
|
||||||
$collectionInternalId = $data[1];
|
$collectionInternalId = $data[1];
|
||||||
|
|
||||||
|
|
@ -200,6 +205,7 @@ class UsageDump extends Action
|
||||||
break;
|
break;
|
||||||
// Database Level
|
// Database Level
|
||||||
case METRIC_DATABASE_LEVEL_STORAGE:
|
case METRIC_DATABASE_LEVEL_STORAGE:
|
||||||
|
Console::log('[' . DateTime::now() . '] Database Level Storage Calculation [' . $key . ']');
|
||||||
$databaseInternalId = $data[0];
|
$databaseInternalId = $data[0];
|
||||||
$collections = $dbForProject->find('database_' . $databaseInternalId);
|
$collections = $dbForProject->find('database_' . $databaseInternalId);
|
||||||
|
|
||||||
|
|
@ -227,6 +233,7 @@ class UsageDump extends Action
|
||||||
break;
|
break;
|
||||||
// Project Level
|
// Project Level
|
||||||
case METRIC_PROJECT_LEVEL_STORAGE:
|
case METRIC_PROJECT_LEVEL_STORAGE:
|
||||||
|
Console::log('[' . DateTime::now() . '] Project Level Storage Calculation [' . $key . ']');
|
||||||
// Get all project databases
|
// Get all project databases
|
||||||
$databases = $dbForProject->find('database');
|
$databases = $dbForProject->find('database');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue