Show a message about setting up the cron and if there was an error running it (#425)

This commit is contained in:
Nabeel S
2019-10-30 09:55:32 -04:00
committed by GitHub
parent ec4f10d43a
commit a45770732a
6 changed files with 134 additions and 3 deletions

View File

@@ -6,11 +6,22 @@ use App\Console\Cron\Hourly;
use App\Console\Cron\Monthly;
use App\Console\Cron\Nightly;
use App\Console\Cron\Weekly;
use App\Services\CronService;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
private $cronSvc;
public function __construct(Application $app, Dispatcher $events)
{
parent::__construct($app, $events);
$this->cronSvc = app(CronService::class);
}
/**
* Define the application's command schedule.
*
@@ -28,6 +39,9 @@ class Kernel extends ConsoleKernel
// When spatie-backups runs
$schedule->command('backup:clean')->daily()->at('01:00');
$schedule->command('backup:run')->daily()->at('02:00');
// Update the last time the cron was run
$this->cronSvc->updateLastRunTime();
}
/**