fix usage task error
This commit is contained in:
parent
e5ad8d63f0
commit
72e112ade8
1 changed files with 4 additions and 2 deletions
|
@ -11,6 +11,7 @@ use Utopia\App;
|
||||||
use Utopia\CLI\Console;
|
use Utopia\CLI\Console;
|
||||||
use Utopia\Database\Database as UtopiaDatabase;
|
use Utopia\Database\Database as UtopiaDatabase;
|
||||||
use Utopia\Validator\WhiteList;
|
use Utopia\Validator\WhiteList;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
class Usage extends Task
|
class Usage extends Task
|
||||||
{
|
{
|
||||||
|
@ -73,13 +74,14 @@ class Usage extends Task
|
||||||
|
|
||||||
$database = $this->getDatabase($register, '_console');
|
$database = $this->getDatabase($register, '_console');
|
||||||
$influxDB = $this->getInfluxDB($register);
|
$influxDB = $this->getInfluxDB($register);
|
||||||
|
$logError = fn(Throwable $error, string $action = 'syncUsageStats') => $this->logError($register, $error, $action);
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'timeseries':
|
case 'timeseries':
|
||||||
$this->aggregateTimeseries($database, $influxDB, $this->logError);
|
$this->aggregateTimeseries($database, $influxDB, $logError);
|
||||||
break;
|
break;
|
||||||
case 'database':
|
case 'database':
|
||||||
$this->aggregateDatabase($database, $this->logError);
|
$this->aggregateDatabase($database, $logError);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Console::error("Unsupported usage aggregation type");
|
Console::error("Unsupported usage aggregation type");
|
||||||
|
|
Loading…
Reference in a new issue