Skip to content

Commit

Permalink
Added cron job health reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
ttimot24 committed Sep 29, 2024
1 parent ab23d63 commit 901b12b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{

\Settings::where('setting', 'scheduler')->update(['value' => 'running']);

if(\App\HorizontCMS::isInstalled()){
foreach(\App\Model\ScheduledTask::where('active',1)->get() as $task){
$schedule->command($task->command.' '.$task->arguments)->cron($task->frequency)->before(function() use ($task) {
Expand Down
7 changes: 7 additions & 0 deletions database/seeders/SettingsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ public function run()
'more' => '1',
]);


DB::table('settings')->insert([
'setting' => 'scheduler',
'value' => "",
'more' => '1',
]);

}
}

0 comments on commit 901b12b

Please sign in to comment.