From 08189c19aaddc5851e2078171a0ede7721aa4845 Mon Sep 17 00:00:00 2001 From: Arthur Pariente Date: Fri, 24 May 2024 18:47:39 +0200 Subject: [PATCH] Use laravel scheduler when proc_open is available --- app/Services/CronService.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Services/CronService.php b/app/Services/CronService.php index c89511a66..5bf197702 100644 --- a/app/Services/CronService.php +++ b/app/Services/CronService.php @@ -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);