Merge pull request #9101 from appwrite/fix-usage-payload-bug

Usage payload debug
This commit is contained in:
Christy Jacob 2024-12-12 22:48:50 +04:00 committed by GitHub
commit 796b06fec5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(1);
var_dump($payload);
}
$project = new Document($document);
$projectId = $project->getInternalId();
foreach ($payload['reduce'] ?? [] as $document) {
if (empty($document)) {
@ -80,6 +81,11 @@ class Usage extends Action
);
}
if (empty($project->getAttribute('database'))) {
var_dump(2);
var_dump($payload);
}
$this->stats[$projectId]['project'] = [
'$id' => $project->getId(),
'$internalId' => $project->getInternalId(),