mirror of
https://github.com/appwrite/appwrite
synced 2026-05-17 22:18:51 +00:00
error fixes
This commit is contained in:
parent
05152da195
commit
d39165889e
2 changed files with 4 additions and 4 deletions
|
|
@ -186,7 +186,7 @@ class Usage
|
|||
if ($document->isEmpty()) {
|
||||
$this->database->createDocument('stats', new Document([
|
||||
'$id' => $id,
|
||||
'period' => $period['key'],
|
||||
'period' => $period,
|
||||
'time' => $time,
|
||||
'metric' => $metric,
|
||||
'value' => $value,
|
||||
|
|
@ -199,7 +199,7 @@ class Usage
|
|||
$document->setAttribute('value', $value)
|
||||
);
|
||||
}
|
||||
$this->latestTime[$metric][$period['key']] = $time;
|
||||
$this->latestTime[$metric][$period] = $time;
|
||||
} catch (\Exception $e) { // if projects are deleted this might fail
|
||||
if (is_callable($this->errorHandler)) {
|
||||
call_user_func($this->errorHandler, "Unable to save data for project {$projectId} and metric {$metric}: {$e->getMessage()}", $e->getTraceAsString());
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class UsageDB extends Usage
|
|||
if ($document->isEmpty()) {
|
||||
$this->database->createDocument('stats', new Document([
|
||||
'$id' => $id,
|
||||
'period' => $period['key'],
|
||||
'period' => $period,
|
||||
'time' => $time,
|
||||
'metric' => $metric,
|
||||
'value' => $value,
|
||||
|
|
@ -179,7 +179,7 @@ class UsageDB extends Usage
|
|||
$this->foreachDocument($projectId, 'buckets', [], function ($bucket) use (&$projectFilesCount, &$projectFilesTotal, $projectId,) {
|
||||
$metric = "storage.buckets.{$bucket->getId()}.files.count";
|
||||
|
||||
$count = $this->count($projectId, 'buckets_' . $bucket->getInternalId(), $metric);
|
||||
$count = $this->count($projectId, 'bucket_' . $bucket->getInternalId(), $metric);
|
||||
$projectFilesCount += $count;
|
||||
|
||||
$metric = "storage.buckets.{$bucket->getId()}.files.total";
|
||||
|
|
|
|||
Loading…
Reference in a new issue