From df208924d64e9c069d883f1c1f3c86db81c86360 Mon Sep 17 00:00:00 2001 From: Nabeel Shahzad Date: Wed, 30 Oct 2019 10:16:21 -0400 Subject: [PATCH] Inline CronService --- app/Console/Kernel.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index b4c0a1af3..ddd6eb6df 100755 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -8,20 +8,10 @@ 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. * @@ -41,7 +31,8 @@ protected function schedule(Schedule $schedule): void $schedule->command('backup:run')->daily()->at('02:00'); // Update the last time the cron was run - $this->cronSvc->updateLastRunTime(); + $cronSvc = app(CronService::class); + $cronSvc->updateLastRunTime(); } /**