1
0
Fork 0
mirror of synced 2024-07-12 09:56:08 +12:00

fix usage task error

This commit is contained in:
Damodar Lohani 2022-10-14 11:01:45 +00:00
parent e5ad8d63f0
commit 72e112ade8

View file

@ -11,6 +11,7 @@ use Utopia\App;
use Utopia\CLI\Console;
use Utopia\Database\Database as UtopiaDatabase;
use Utopia\Validator\WhiteList;
use Throwable;
class Usage extends Task
{
@ -73,13 +74,14 @@ class Usage extends Task
$database = $this->getDatabase($register, '_console');
$influxDB = $this->getInfluxDB($register);
$logError = fn(Throwable $error, string $action = 'syncUsageStats') => $this->logError($register, $error, $action);
switch ($type) {
case 'timeseries':
$this->aggregateTimeseries($database, $influxDB, $this->logError);
$this->aggregateTimeseries($database, $influxDB, $logError);
break;
case 'database':
$this->aggregateDatabase($database, $this->logError);
$this->aggregateDatabase($database, $logError);
break;
default:
Console::error("Unsupported usage aggregation type");