diff --git a/src/Appwrite/Platform/Workers/Usage.php b/src/Appwrite/Platform/Workers/Usage.php index 98b2ea32c7..8199fe73a7 100644 --- a/src/Appwrite/Platform/Workers/Usage.php +++ b/src/Appwrite/Platform/Workers/Usage.php @@ -60,12 +60,13 @@ class Usage extends Action } $document = $payload['project'] ?? []; + $project = new Document($document); - if (empty($document)) { + if (empty($project->getAttribute('database'))) { var_dump($payload); + return; } - $project = new Document($document); $projectId = $project->getInternalId(); foreach ($payload['reduce'] ?? [] as $document) { if (empty($document)) { @@ -80,6 +81,7 @@ class Usage extends Action ); } + $this->stats[$projectId]['project'] = [ '$id' => $project->getId(), '$internalId' => $project->getInternalId(), diff --git a/src/Appwrite/Platform/Workers/UsageDump.php b/src/Appwrite/Platform/Workers/UsageDump.php index 1fe6b742b8..78235ce7e9 100644 --- a/src/Appwrite/Platform/Workers/UsageDump.php +++ b/src/Appwrite/Platform/Workers/UsageDump.php @@ -71,10 +71,6 @@ class UsageDump extends Action $project = new Document($document); - if (empty($project->getAttribute('database'))) { - var_dump($stats); - } - /** * End temp bug fallback */