Merge pull request #11519 from appwrite/copilot/fix-received-at-timestamp

Update usage to use timestamp of event rather than current timestamp
This commit is contained in:
Damodar Lohani
2026-03-11 07:21:42 +05:45
committed by GitHub
+1 -1
View File
@@ -160,7 +160,7 @@ class StatsUsage extends Action
}
$this->stats[$projectId]['project'] = $project;
$this->stats[$projectId]['receivedAt'] = DateTime::now();
$this->stats[$projectId]['receivedAt'] = DateTime::format(new \DateTime('@' . $message->getTimestamp()));
foreach ($payload['metrics'] ?? [] as $metric) {
$this->keys++;
if (!isset($this->stats[$projectId]['keys'][$metric['key']])) {