Skip to content

Commit

Permalink
Use laravel scheduler when proc_open is available
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurpar06 committed May 24, 2024
1 parent 84ecc61 commit 08189c1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/Services/CronService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,16 @@ public function getCronPath(): string
$php_exec .= ' -d register_argc_argv=On';
}

$command = base_path('bin/cron');

// If the server has proc_open then use the default laravel scheduler
if (function_exists('proc_open')) {
$command = base_path('artisan schedule:run');
}

$path = [
$php_exec,
base_path('bin/cron'),
$command,
];

return implode(' ', $path);
Expand Down

0 comments on commit 08189c1

Please sign in to comment.