1
0
Fork 0
mirror of synced 2024-07-04 14:10:33 +12:00

fix issues

This commit is contained in:
Damodar Lohani 2022-10-22 03:11:35 +00:00
parent ff6c6003fc
commit e75dfa882b
2 changed files with 1 additions and 4 deletions

View file

@ -216,10 +216,8 @@ class Database extends Calculator
*/
private function count(UtopiaDatabase $database, string $projectId, string $collection, ?string $metric = null): int
{
$this->database->setNamespace('_' . $projectId);
try {
$count = $this->database->count($collection);
$count = $database->count($collection);
if (!is_null($metric)) {
$this->createPerPeriodMetric($database, $projectId, (string) $metric, $count);
}

View file

@ -303,7 +303,6 @@ class TimeSeries extends Calculator
private function createOrUpdateMetric(string $projectId, string $time, string $period, string $metric, int $value, int $type): void
{
$id = \md5("{$time}_{$period}_{$metric}");
$this->database->setNamespace('console');
$project = $this->database->getDocument('projects', $projectId);
$database = call_user_func($this->getProjectDB, $project);