From 89aa61b17cdcca4759c94b2b7d51156dc7ee7aa2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 6 Feb 2025 03:37:01 +0000 Subject: [PATCH] fix duplicate constant --- src/Appwrite/Platform/Workers/StatsUsageDump.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Appwrite/Platform/Workers/StatsUsageDump.php b/src/Appwrite/Platform/Workers/StatsUsageDump.php index 6d3e2dd15e..70b95a117f 100644 --- a/src/Appwrite/Platform/Workers/StatsUsageDump.php +++ b/src/Appwrite/Platform/Workers/StatsUsageDump.php @@ -11,12 +11,12 @@ use Utopia\Platform\Action; use Utopia\Queue\Message; use Utopia\System\System; -const METRIC_COLLECTION_LEVEL_STORAGE = 4; -const METRIC_DATABASE_LEVEL_STORAGE = 3; -const METRIC_PROJECT_LEVEL_STORAGE = 2; class StatsUsageDump extends Action { + const METRIC_COLLECTION_LEVEL_STORAGE = 4; + const METRIC_DATABASE_LEVEL_STORAGE = 3; + const METRIC_PROJECT_LEVEL_STORAGE = 2; protected array $stats = []; /** @@ -204,7 +204,7 @@ class StatsUsageDump extends Action switch (count($data)) { // Collection Level - case METRIC_COLLECTION_LEVEL_STORAGE: + case self::METRIC_COLLECTION_LEVEL_STORAGE: Console::log('[' . DateTime::now() . '] Collection Level Storage Calculation [' . $key . ']'); $databaseInternalId = $data[0]; $collectionInternalId = $data[1]; @@ -237,7 +237,7 @@ class StatsUsageDump extends Action $updateMetric($dbForProject, $project, $diff, $projectKey, $period, $time); break; // Database Level - case METRIC_DATABASE_LEVEL_STORAGE: + case self::METRIC_DATABASE_LEVEL_STORAGE: Console::log('[' . DateTime::now() . '] Database Level Storage Calculation [' . $key . ']'); $databaseInternalId = $data[0]; @@ -277,7 +277,7 @@ class StatsUsageDump extends Action $updateMetric($dbForProject, $project, $diff, $projectKey, $period, $time); break; // Project Level - case METRIC_PROJECT_LEVEL_STORAGE: + case self::METRIC_PROJECT_LEVEL_STORAGE: Console::log('[' . DateTime::now() . '] Project Level Storage Calculation [' . $key . ']'); // Get all project databases $databases = $dbForProject->find('database');