mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Code reordering and reformatting. I should really start employing style CI.
This commit is contained in:
@@ -32,16 +32,14 @@ use Carbon\Carbon;
|
||||
*/
|
||||
abstract class AbstractCronjob
|
||||
{
|
||||
public bool $jobErrored;
|
||||
public bool $jobFired;
|
||||
public bool $jobSucceeded;
|
||||
public ?string $message;
|
||||
public int $timeBetweenRuns = 43200;
|
||||
protected Carbon $date;
|
||||
protected bool $force;
|
||||
|
||||
public bool $jobFired;
|
||||
public bool $jobSucceeded;
|
||||
public bool $jobErrored;
|
||||
|
||||
public ?string $message;
|
||||
|
||||
/**
|
||||
* AbstractCronjob constructor.
|
||||
*/
|
||||
@@ -65,7 +63,7 @@ abstract class AbstractCronjob
|
||||
*/
|
||||
final public function setDate(Carbon $date): void
|
||||
{
|
||||
$newDate = clone $date;
|
||||
$newDate = clone $date;
|
||||
$this->date = $newDate;
|
||||
}
|
||||
|
||||
|
@@ -23,6 +23,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support\Cronjobs;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use FireflyIII\Jobs\CreateAutoBudgetLimits;
|
||||
use FireflyIII\Models\Configuration;
|
||||
@@ -43,7 +44,7 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
$config = app('fireflyconfig')->get('last_ab_job', 0);
|
||||
$lastTime = (int)$config->data;
|
||||
$diff = time() - $lastTime;
|
||||
$diffForHumans = Carbon::now()->diffForHumans(Carbon::createFromTimestamp($lastTime),null, true);
|
||||
$diffForHumans = Carbon::now()->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Auto budget cron-job has never fired before.');
|
||||
}
|
||||
@@ -53,6 +54,7 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
if (false === $this->force) {
|
||||
Log::info('The auto budget cron-job will not fire now.');
|
||||
$this->message = sprintf('It has been %s since the auto budget cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -44,7 +44,7 @@ class RecurringCronjob extends AbstractCronjob
|
||||
$config = app('fireflyconfig')->get('last_rt_job', 0);
|
||||
$lastTime = (int)$config->data;
|
||||
$diff = time() - $lastTime;
|
||||
$diffForHumans = Carbon::now()->diffForHumans(Carbon::createFromTimestamp($lastTime), null,true);
|
||||
$diffForHumans = Carbon::now()->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Recurring transactions cron-job has never fired before.');
|
||||
|
Reference in New Issue
Block a user