mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-03 03:21:39 +00:00
Files for new reelase.
This commit is contained in:
@@ -46,7 +46,7 @@ class CronController extends Controller
|
||||
$config = $request->getAll();
|
||||
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
|
||||
Log::debug(sprintf('Date is %s', $config['date']->toIsoString()));
|
||||
$return = [];
|
||||
$return['recurring_transactions'] = $this->runRecurring($config['force'], $config['date']);
|
||||
$return['auto_budgets'] = $this->runAutoBudget($config['force'], $config['date']);
|
||||
|
@@ -57,8 +57,9 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
public function __construct(?Carbon $date)
|
||||
{
|
||||
if (null !== $date) {
|
||||
$date->startOfDay();
|
||||
$this->date = $date;
|
||||
$newDate = clone $date;
|
||||
$newDate->startOfDay();
|
||||
$this->date = $newDate;
|
||||
Log::debug(sprintf('Created new CreateAutoBudgetLimits("%s")', $this->date->format('Y-m-d')));
|
||||
}
|
||||
}
|
||||
@@ -293,7 +294,8 @@ class CreateAutoBudgetLimits implements ShouldQueue
|
||||
*/
|
||||
public function setDate(Carbon $date): void
|
||||
{
|
||||
$date->startOfDay();
|
||||
$this->date = $date;
|
||||
$newDate = clone $date;
|
||||
$newDate->startOfDay();
|
||||
$this->date = $newDate;
|
||||
}
|
||||
}
|
||||
|
@@ -69,8 +69,14 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
public function __construct(?Carbon $date)
|
||||
{
|
||||
if (null !== $date) {
|
||||
$date->startOfDay();
|
||||
$this->date = $date;
|
||||
$newDate = clone $date;
|
||||
$newDate->startOfDay();
|
||||
$this->date = $newDate;
|
||||
}
|
||||
if(null === $date) {
|
||||
$newDate = new Carbon;
|
||||
$newDate->startOfDay();
|
||||
$this->date = $newDate;
|
||||
}
|
||||
$this->repository = app(RecurringRepositoryInterface::class);
|
||||
$this->journalRepository = app(JournalRepositoryInterface::class);
|
||||
@@ -457,8 +463,9 @@ class CreateRecurringTransactions implements ShouldQueue
|
||||
*/
|
||||
public function setDate(Carbon $date): void
|
||||
{
|
||||
$date->startOfDay();
|
||||
$this->date = $date;
|
||||
$newDate = clone $date;
|
||||
$newDate->startOfDay();
|
||||
$this->date = $newDate;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -50,8 +50,8 @@ abstract class AbstractCronjob
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->force = false;
|
||||
$this->date = today(config('app.timezone'));
|
||||
$this->force = false;
|
||||
$this->date = today(config('app.timezone'));
|
||||
$this->jobErrored = false;
|
||||
$this->jobSucceeded = false;
|
||||
$this->jobFired = false;
|
||||
@@ -68,7 +68,8 @@ abstract class AbstractCronjob
|
||||
*/
|
||||
public function setDate(Carbon $date): void
|
||||
{
|
||||
$this->date = $date;
|
||||
$newDate = clone $date;
|
||||
$this->date = $newDate;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -24,7 +24,6 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Support\Cronjobs;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use FireflyIII\Exceptions\FireflyException;
|
||||
use FireflyIII\Jobs\CreateRecurringTransactions;
|
||||
use FireflyIII\Models\Configuration;
|
||||
@@ -55,7 +54,10 @@ class RecurringCronjob extends AbstractCronjob
|
||||
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.');
|
||||
$this->message = sprintf('It has been %s since the recurring transactions cron-job has fired. It will not fire now.', $diffForHumans);
|
||||
$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;
|
||||
$this->jobSucceeded = false;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -80,7 +82,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')));
|
||||
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);
|
||||
|
Reference in New Issue
Block a user