mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Rename command.
This commit is contained in:
@@ -50,7 +50,7 @@ class Cron extends Command
|
||||
{--download-cer : Download exchange rates. Other tasks will be skipped unless also requested.}
|
||||
{--create-recurring : Create recurring transactions. Other tasks will be skipped unless also requested.}
|
||||
{--create-auto-budgets : Create auto budgets. Other tasks will be skipped unless also requested.}
|
||||
{--send-bill-warnings : Send bill warnings. Other tasks will be skipped unless also requested.}
|
||||
{--send-subscription-warnings : Send subscription warnings. Other tasks will be skipped unless also requested.}
|
||||
{--send-webhook-messages : Sends any stray webhook messages (with a maximum of 5).}
|
||||
';
|
||||
|
||||
@@ -59,7 +59,7 @@ class Cron extends Command
|
||||
$doAll = !$this->option('download-cer')
|
||||
&& !$this->option('create-recurring')
|
||||
&& !$this->option('create-auto-budgets')
|
||||
&& !$this->option('send-bill-warnings')
|
||||
&& !$this->option('send-subscription-warnings')
|
||||
&& !$this->option('check-version')
|
||||
&& !$this->option('send-webhook-messages');
|
||||
$date = null;
|
||||
@@ -116,9 +116,9 @@ class Cron extends Command
|
||||
}
|
||||
|
||||
// Fire bill warning cron job
|
||||
if ($doAll || $this->option('send-bill-warnings')) {
|
||||
if ($doAll || $this->option('send-subscription-warnings')) {
|
||||
try {
|
||||
$this->billWarningCronJob($force, $date);
|
||||
$this->subscriptionWarningCronJob($force, $date);
|
||||
} catch (FireflyException $e) {
|
||||
app('log')->error($e->getMessage());
|
||||
app('log')->error($e->getTraceAsString());
|
||||
@@ -231,25 +231,25 @@ class Cron extends Command
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
private function billWarningCronJob(bool $force, ?Carbon $date): void
|
||||
private function subscriptionWarningCronJob(bool $force, ?Carbon $date): void
|
||||
{
|
||||
$autoBudget = new BillWarningCronjob();
|
||||
$autoBudget->setForce($force);
|
||||
$subscriptionWarningJob = new BillWarningCronjob();
|
||||
$subscriptionWarningJob->setForce($force);
|
||||
// set date in cron job:
|
||||
if ($date instanceof Carbon) {
|
||||
$autoBudget->setDate($date);
|
||||
$subscriptionWarningJob->setDate($date);
|
||||
}
|
||||
|
||||
$autoBudget->fire();
|
||||
$subscriptionWarningJob->fire();
|
||||
|
||||
if ($autoBudget->jobErrored) {
|
||||
$this->friendlyError(sprintf('Error in "bill warnings" cron: %s', $autoBudget->message));
|
||||
if ($subscriptionWarningJob->jobErrored) {
|
||||
$this->friendlyError(sprintf('Error in "subscription warnings" cron: %s', $subscriptionWarningJob->message));
|
||||
}
|
||||
if ($autoBudget->jobFired) {
|
||||
$this->friendlyInfo(sprintf('"Send bill warnings" cron fired: %s', $autoBudget->message));
|
||||
if ($subscriptionWarningJob->jobFired) {
|
||||
$this->friendlyInfo(sprintf('"Send subscription warnings" cron fired: %s', $subscriptionWarningJob->message));
|
||||
}
|
||||
if ($autoBudget->jobSucceeded) {
|
||||
$this->friendlyPositive(sprintf('"Send bill warnings" cron ran with success: %s', $autoBudget->message));
|
||||
if ($subscriptionWarningJob->jobSucceeded) {
|
||||
$this->friendlyPositive(sprintf('"Send subscription warnings" cron ran with success: %s', $subscriptionWarningJob->message));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user