Added settings section and custom cron scheduling

This commit is contained in:
Henry Whitaker
2020-05-19 01:08:35 +01:00
parent e889a4f487
commit 2a5fd76c42
14 changed files with 288 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Console;
use App\Helpers\SettingsHelper;
use App\Helpers\SpeedtestHelper;
use App\Jobs\SpeedtestJob;
use Illuminate\Console\Scheduling\Schedule;
@@ -26,9 +27,7 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->call(function() {
SpeedtestJob::dispatch();
})->hourlyAt(0);
$schedule->job(new SpeedtestJob)->cron(SettingsHelper::get('schedule')['value']);
}
/**