mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 09:28:40 +00:00
Merge pull request #9098 from appwrite/fix-usage-payload-bug
payload bug fix
This commit is contained in:
commit
653db9d7ad
1 changed files with 21 additions and 2 deletions
|
|
@ -57,9 +57,28 @@ class UsageDump extends Action
|
||||||
throw new Exception('Missing payload');
|
throw new Exception('Missing payload');
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: rename both usage workers @shimonewman
|
|
||||||
foreach ($payload['stats'] ?? [] as $stats) {
|
foreach ($payload['stats'] ?? [] as $stats) {
|
||||||
$project = new Document($stats['project'] ?? []);
|
//$project = new Document($stats['project'] ?? []);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start temp bug fallback
|
||||||
|
*/
|
||||||
|
$document = $stats['project'] ?? [];
|
||||||
|
if (!empty($document['$uid'])) {
|
||||||
|
$document['$id'] = $document['$uid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$project = new Document($document);
|
||||||
|
|
||||||
|
if (empty($project->getAttribute('database'))) {
|
||||||
|
var_dump($stats);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* End temp bug fallback
|
||||||
|
*/
|
||||||
|
|
||||||
$numberOfKeys = !empty($stats['keys']) ? count($stats['keys']) : 0;
|
$numberOfKeys = !empty($stats['keys']) ? count($stats['keys']) : 0;
|
||||||
$receivedAt = $stats['receivedAt'] ?? 'NONE';
|
$receivedAt = $stats['receivedAt'] ?? 'NONE';
|
||||||
if ($numberOfKeys === 0) {
|
if ($numberOfKeys === 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue