command('email:send')->everyFiveMinutes()->withoutOverlapping(); $schedule->command('missed-calls:alert')->everyFiveMinutes()->withoutOverlapping(); // Catch outbound CDR rows (FAILED + any other disposition) that bypassed // agihangupaction and were never processed by ProcessOutboundCallJob. $schedule->command('reports:outbound:poll-recent')->everyFiveMinutes()->withoutOverlapping()->runInBackground(); $schedule->command('ami:flush-events')->everyFiveMinutes()->withoutOverlapping()->runInBackground(); $schedule->command('callbacks:process-order-requests')->everyMinute()->withoutOverlapping()->runInBackground(); $schedule->command('egy:cache')->daily(); // $schedule->command('call:update')->everyFiveMinutes(); // Set information about cron last run $schedule->call(static function () { Settings::set('cron_last_run', Carbon::now()); })->everyMinute(); } /** * Register the commands for the application. * * @return void */ protected function commands() { // $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } protected function osProcessIsRunning($needle) { // get process status. the "-ww"-option is important to get the full output! exec('ps aux -ww', $process_status); // search $needle in process status $result = array_filter($process_status, function ($var) use ($needle) { return strpos($var, $needle); }); // if the result is not empty, the needle exists in running processes if (!empty($result)) { return true; } return false; } }