mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Limit some collection features.
This commit is contained in:
@@ -99,7 +99,7 @@ class ApplyRules extends Command
|
||||
|
||||
$result = $this->verifyInput();
|
||||
if (false === $result) {
|
||||
app('telemetry')->feature('system.command.errored', $this->signature);
|
||||
app('telemetry')->feature('system.command.errored', 'firefly-iii:apply-rules');
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -119,7 +119,7 @@ class ApplyRules extends Command
|
||||
$this->warn(' --rule_groups=1,2,...');
|
||||
$this->warn(' --all_rules');
|
||||
|
||||
app('telemetry')->feature('system.command.errored', $this->signature);
|
||||
app('telemetry')->feature('system.command.errored', 'firefly-iii:apply-rules');
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ class ApplyRules extends Command
|
||||
// file the rule(s)
|
||||
$ruleEngine->fire();
|
||||
|
||||
app('telemetry')->feature('system.command.executed', $this->signature);
|
||||
app('telemetry')->feature('system.command.executed', 'firefly-iii:apply-rules');
|
||||
|
||||
$this->line('');
|
||||
$end = round(microtime(true) - $start, 2);
|
||||
|
@@ -25,11 +25,9 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Console\Commands\Tools;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Support\Cronjobs\AutoBudgetCronjob;
|
||||
use FireflyIII\Support\Cronjobs\RecurringCronjob;
|
||||
use FireflyIII\Support\Cronjobs\TelemetryCronjob;
|
||||
use Illuminate\Console\Command;
|
||||
use InvalidArgumentException;
|
||||
use Log;
|
||||
@@ -92,20 +90,9 @@ class Cron extends Command
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
|
||||
/*
|
||||
* Fire telemetry cron job
|
||||
*/
|
||||
try {
|
||||
$this->telemetryCronJob($force, $date);
|
||||
} catch (FireflyException $e) {
|
||||
Log::error($e->getMessage());
|
||||
Log::error($e->getTraceAsString());
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
|
||||
$this->info('More feedback on the cron jobs can be found in the log files.');
|
||||
|
||||
app('telemetry')->feature('system.command.executed', $this->signature);
|
||||
app('telemetry')->feature('system.command.executed', 'firefly-iii:cron');
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -127,13 +114,13 @@ class Cron extends Command
|
||||
}
|
||||
|
||||
$recurring->fire();
|
||||
if($recurring->jobErrored) {
|
||||
if ($recurring->jobErrored) {
|
||||
$this->error(sprintf('Error in "create recurring transactions" cron: %s', $recurring->message));
|
||||
}
|
||||
if($recurring->jobFired) {
|
||||
if ($recurring->jobFired) {
|
||||
$this->error(sprintf('"Create recurring transactions" cron fired: %s', $recurring->message));
|
||||
}
|
||||
if($recurring->jobSucceeded) {
|
||||
if ($recurring->jobSucceeded) {
|
||||
$this->error(sprintf('"Create recurring transactions" cron ran with success: %s', $recurring->message));
|
||||
}
|
||||
}
|
||||
@@ -154,50 +141,15 @@ class Cron extends Command
|
||||
|
||||
$autoBudget->fire();
|
||||
|
||||
if($autoBudget->jobErrored) {
|
||||
if ($autoBudget->jobErrored) {
|
||||
$this->error(sprintf('Error in "create auto budgets" cron: %s', $autoBudget->message));
|
||||
}
|
||||
if($autoBudget->jobFired) {
|
||||
if ($autoBudget->jobFired) {
|
||||
$this->error(sprintf('"Create auto budgets" cron fired: %s', $autoBudget->message));
|
||||
}
|
||||
if($autoBudget->jobSucceeded) {
|
||||
if ($autoBudget->jobSucceeded) {
|
||||
$this->error(sprintf('"Create auto budgets" cron ran with success: %s', $autoBudget->message));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $force
|
||||
* @param Carbon|null $date
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function telemetryCronJob(bool $force, ?Carbon $date): void
|
||||
{
|
||||
if (false === config('firefly.send_telemetry') || false === config('firefly.feature_flags.telemetry')) {
|
||||
// if not configured to do anything with telemetry, do nothing.
|
||||
return;
|
||||
}
|
||||
$telemetry = new TelemetryCronjob;
|
||||
$telemetry->setForce($force);
|
||||
|
||||
// set date in cron job:
|
||||
if (null !== $date) {
|
||||
$telemetry->setDate($date);
|
||||
}
|
||||
|
||||
$telemetry->fire();
|
||||
|
||||
if($telemetry->jobErrored) {
|
||||
$this->error(sprintf('Error in "send telemetry" cron: %s', $telemetry->message));
|
||||
}
|
||||
if($telemetry->jobFired) {
|
||||
$this->error(sprintf('"Send telemetry" cron fired: %s', $telemetry->message));
|
||||
}
|
||||
if($telemetry->jobSucceeded) {
|
||||
$this->error(sprintf('"Send telemetry" cron ran with success: %s', $telemetry->message));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user