mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Remove static references
This commit is contained in:
@@ -45,13 +45,13 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
$diff = time() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Auto budget cron-job has never fired before.');
|
||||
app('log')->info('Auto budget cron-job has never fired before.');
|
||||
}
|
||||
// less than half a day ago:
|
||||
if ($lastTime > 0 && $diff <= 43200) {
|
||||
Log::info(sprintf('It has been %s since the auto budget cron-job has fired.', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the auto budget cron-job has fired.', $diffForHumans));
|
||||
if (false === $this->force) {
|
||||
Log::info('The auto budget cron-job will not fire now.');
|
||||
app('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;
|
||||
@@ -59,12 +59,12 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
|
||||
// fire job regardless.
|
||||
if (true === $this->force) {
|
||||
Log::info('Execution of the auto budget cron-job has been FORCED.');
|
||||
app('log')->info('Execution of the auto budget cron-job has been FORCED.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastTime > 0 && $diff > 43200) {
|
||||
Log::info(sprintf('It has been %s since the auto budget cron-job has fired. It will fire now!', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the auto budget cron-job has fired. It will fire now!', $diffForHumans));
|
||||
}
|
||||
|
||||
$this->fireAutoBudget();
|
||||
@@ -76,7 +76,7 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
*/
|
||||
private function fireAutoBudget(): void
|
||||
{
|
||||
Log::info(sprintf('Will now fire auto budget cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
app('log')->info(sprintf('Will now fire auto budget cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
/** @var CreateAutoBudgetLimits $job */
|
||||
$job = app(CreateAutoBudgetLimits::class, [$this->date]);
|
||||
$job->setDate($this->date);
|
||||
@@ -89,6 +89,6 @@ class AutoBudgetCronjob extends AbstractCronjob
|
||||
$this->message = 'Auto-budget cron job fired successfully.';
|
||||
|
||||
app('fireflyconfig')->set('last_ab_job', (int)$this->date->format('U'));
|
||||
Log::info('Done with auto budget cron job task.');
|
||||
app('log')->info('Done with auto budget cron job task.');
|
||||
}
|
||||
}
|
||||
|
@@ -51,13 +51,13 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
|
||||
if (0 === $lastTime) {
|
||||
Log::info('The bill warning cron-job has never fired before.');
|
||||
app('log')->info('The bill warning cron-job has never fired before.');
|
||||
}
|
||||
// less than half a day ago:
|
||||
if ($lastTime > 0 && $diff <= 43200) {
|
||||
Log::info(sprintf('It has been %s since the bill warning cron-job has fired.', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the bill warning cron-job has fired.', $diffForHumans));
|
||||
if (false === $this->force) {
|
||||
Log::info('The cron-job will not fire now.');
|
||||
app('log')->info('The cron-job will not fire now.');
|
||||
$this->message = sprintf('It has been %s since the bill warning cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
$this->jobFired = false;
|
||||
$this->jobErrored = false;
|
||||
@@ -68,12 +68,12 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
|
||||
// fire job regardless.
|
||||
if (true === $this->force) {
|
||||
Log::info('Execution of the bill warning cron-job has been FORCED.');
|
||||
app('log')->info('Execution of the bill warning cron-job has been FORCED.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastTime > 0 && $diff > 43200) {
|
||||
Log::info(sprintf('It has been %s since the bill warning cron-job has fired. It will fire now!', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the bill warning cron-job has fired. It will fire now!', $diffForHumans));
|
||||
}
|
||||
|
||||
$this->fireWarnings();
|
||||
@@ -86,7 +86,7 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
*/
|
||||
private function fireWarnings(): void
|
||||
{
|
||||
Log::info(sprintf('Will now fire bill warning job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
app('log')->info(sprintf('Will now fire bill warning job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
/** @var WarnAboutBills $job */
|
||||
$job = app(WarnAboutBills::class);
|
||||
$job->setDate($this->date);
|
||||
@@ -100,7 +100,7 @@ class BillWarningCronjob extends AbstractCronjob
|
||||
$this->message = 'Bill warning cron job fired successfully.';
|
||||
|
||||
app('fireflyconfig')->set('last_bw_job', (int)$this->date->format('U'));
|
||||
Log::info(sprintf('Marked the last time this job has run as "%s" (%d)', $this->date->format('Y-m-d H:i:s'), (int)$this->date->format('U')));
|
||||
Log::info('Done with bill warning cron job task.');
|
||||
app('log')->info(sprintf('Marked the last time this job has run as "%s" (%d)', $this->date->format('Y-m-d H:i:s'), (int)$this->date->format('U')));
|
||||
app('log')->info('Done with bill warning cron job task.');
|
||||
}
|
||||
}
|
||||
|
@@ -45,13 +45,13 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
$diff = time() - $lastTime;
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Exchange rates cron-job has never fired before.');
|
||||
app('log')->info('Exchange rates cron-job has never fired before.');
|
||||
}
|
||||
// less than half a day ago:
|
||||
if ($lastTime > 0 && $diff <= 43200) {
|
||||
Log::info(sprintf('It has been %s since the exchange rates cron-job has fired.', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the exchange rates cron-job has fired.', $diffForHumans));
|
||||
if (false === $this->force) {
|
||||
Log::info('The exchange rates cron-job will not fire now.');
|
||||
app('log')->info('The exchange rates cron-job will not fire now.');
|
||||
$this->message = sprintf('It has been %s since the exchange rates cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
|
||||
return;
|
||||
@@ -59,12 +59,12 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
|
||||
// fire job regardless.
|
||||
if (true === $this->force) {
|
||||
Log::info('Execution of the exchange rates cron-job has been FORCED.');
|
||||
app('log')->info('Execution of the exchange rates cron-job has been FORCED.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastTime > 0 && $diff > 43200) {
|
||||
Log::info(sprintf('It has been %s since the exchange rates cron-job has fired. It will fire now!', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the exchange rates cron-job has fired. It will fire now!', $diffForHumans));
|
||||
}
|
||||
|
||||
$this->fireExchangeRateJob();
|
||||
@@ -76,7 +76,7 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
*/
|
||||
private function fireExchangeRateJob(): void
|
||||
{
|
||||
Log::info(sprintf('Will now fire exchange rates cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
app('log')->info(sprintf('Will now fire exchange rates cron job task for date "%s".', $this->date->format('Y-m-d')));
|
||||
/** @var DownloadExchangeRates $job */
|
||||
$job = app(DownloadExchangeRates::class);
|
||||
$job->setDate($this->date);
|
||||
@@ -89,6 +89,6 @@ class ExchangeRatesCronjob extends AbstractCronjob
|
||||
$this->message = 'Exchange rates cron job fired successfully.';
|
||||
|
||||
app('fireflyconfig')->set('last_cer_job', (int)$this->date->format('U'));
|
||||
Log::info('Done with exchange rates job task.');
|
||||
app('log')->info('Done with exchange rates job task.');
|
||||
}
|
||||
}
|
||||
|
@@ -51,13 +51,13 @@ class RecurringCronjob extends AbstractCronjob
|
||||
$diffForHumans = today(config('app.timezone'))->diffForHumans(Carbon::createFromTimestamp($lastTime), null, true);
|
||||
|
||||
if (0 === $lastTime) {
|
||||
Log::info('Recurring transactions cron-job has never fired before.');
|
||||
app('log')->info('Recurring transactions cron-job has never fired before.');
|
||||
}
|
||||
// less than half a day ago:
|
||||
if ($lastTime > 0 && $diff <= 43200) {
|
||||
Log::info(sprintf('It has been %s since the recurring transactions cron-job has fired.', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the recurring transactions cron-job has fired.', $diffForHumans));
|
||||
if (false === $this->force) {
|
||||
Log::info('The cron-job will not fire now.');
|
||||
app('log')->info('The cron-job will not fire now.');
|
||||
$this->message = sprintf('It has been %s since the recurring transactions cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
$this->jobFired = false;
|
||||
$this->jobErrored = false;
|
||||
@@ -68,12 +68,12 @@ class RecurringCronjob extends AbstractCronjob
|
||||
|
||||
// fire job regardless.
|
||||
if (true === $this->force) {
|
||||
Log::info('Execution of the recurring transaction cron-job has been FORCED.');
|
||||
app('log')->info('Execution of the recurring transaction cron-job has been FORCED.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($lastTime > 0 && $diff > 43200) {
|
||||
Log::info(sprintf('It has been %s since the recurring transactions cron-job has fired. It will fire now!', $diffForHumans));
|
||||
app('log')->info(sprintf('It has been %s since the recurring transactions cron-job has fired. It will fire now!', $diffForHumans));
|
||||
}
|
||||
|
||||
$this->fireRecurring();
|
||||
@@ -86,7 +86,7 @@ class RecurringCronjob extends AbstractCronjob
|
||||
*/
|
||||
private function fireRecurring(): void
|
||||
{
|
||||
Log::info(sprintf('Will now fire recurring cron job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
app('log')->info(sprintf('Will now fire recurring cron job task for date "%s".', $this->date->format('Y-m-d H:i:s')));
|
||||
/** @var CreateRecurringTransactions $job */
|
||||
$job = app(CreateRecurringTransactions::class);
|
||||
$job->setDate($this->date);
|
||||
@@ -100,7 +100,7 @@ class RecurringCronjob extends AbstractCronjob
|
||||
$this->message = 'Recurring transactions cron job fired successfully.';
|
||||
|
||||
app('fireflyconfig')->set('last_rt_job', (int)$this->date->format('U'));
|
||||
Log::info(sprintf('Marked the last time this job has run as "%s" (%d)', $this->date->format('Y-m-d H:i:s'), (int)$this->date->format('U')));
|
||||
Log::info('Done with recurring cron job task.');
|
||||
app('log')->info(sprintf('Marked the last time this job has run as "%s" (%d)', $this->date->format('Y-m-d H:i:s'), (int)$this->date->format('U')));
|
||||
app('log')->info('Done with recurring cron job task.');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user