Various code cleanup.

This commit is contained in:
James Cole
2021-06-13 07:04:18 +02:00
parent 85204de9aa
commit c98706fac0
24 changed files with 39 additions and 65 deletions

View File

@@ -132,11 +132,9 @@ class ExportData extends Command
if (!empty($data)) {
try {
$this->exportData($options, $data);
app('telemetry')->feature('system.command.executed', 'firefly-iii:export-data');
} catch (FireflyException $e) {
$this->error(sprintf('Could not store data: %s', $e->getMessage()));
app('telemetry')->feature('system.command.errored', 'firefly-iii:export-data');
$returnCode = 1;
}
}

View File

@@ -84,8 +84,6 @@ class ScanAttachments extends Command
$this->line(sprintf('Fixed attachment #%d', $attachment->id));
}
app('telemetry')->feature('system.command.executed', $this->signature);
return 0;
}
}

View File

@@ -60,8 +60,6 @@ class SetLatestVersion extends Command
app('fireflyconfig')->set('ff3_version', config('firefly.version'));
$this->line('Updated version.');
app('telemetry')->feature('system.command.executed', 'firefly-iii:set-latest-version');
return 0;
}
}

View File

@@ -99,8 +99,6 @@ class ApplyRules extends Command
$result = $this->verifyInput();
if (false === $result) {
app('telemetry')->feature('system.command.errored', 'firefly-iii:apply-rules');
return 1;
}
@@ -119,8 +117,6 @@ class ApplyRules extends Command
$this->warn(' --rule_groups=1,2,...');
$this->warn(' --all_rules');
app('telemetry')->feature('system.command.errored', 'firefly-iii:apply-rules');
return 1;
}
@@ -148,8 +144,6 @@ class ApplyRules extends Command
// file the rule(s)
$ruleEngine->fire();
app('telemetry')->feature('system.command.executed', 'firefly-iii:apply-rules');
$this->line('');
$end = round(microtime(true) - $start, 2);
$this->line(sprintf('Done in %s seconds!', $end));

View File

@@ -92,8 +92,6 @@ class Cron extends Command
$this->info('More feedback on the cron jobs can be found in the log files.');
app('telemetry')->feature('system.command.executed', 'firefly-iii:cron');
return 0;
}

View File

@@ -63,18 +63,6 @@ class UpgradeFireflyInstructions extends Command
$this->installInstructions();
}
// collect system telemetry
$isDocker = true === env('IS_DOCKER', false) ? 'true' : 'false';
app('telemetry')->feature('system.php.version', PHP_VERSION);
app('telemetry')->feature('system.os.version', PHP_OS);
app('telemetry')->feature('system.database.driver', env('DB_CONNECTION', '(unknown)'));
app('telemetry')->feature('system.os.is_docker', $isDocker);
try {
app('telemetry')->feature('system.users.count', (string)User::count());
} catch (QueryException $e) {
// @ignoreException
}
return 0;
}