How to run cron job once a job done without taking any time interval in laravel

I want to run cron job once a job is done without taking any time interval. As I know smallest time interval is 1 minute. I also made custom execution like every 20 second. By I want once a job is done it run automatically without taking any time interval. Also considering Overlapping. Thanks in advance

Here is my code

protected function schedule(Schedule $schedule)
{
$schedule->command('second:execute')
->everyMinute();
//->withoutOverlapping();
}

In commands

public function handle()
{
while (true) {
\Log::useDailyFiles( storage_path() . '/logs/scheduler.log' );
\Log::info( 'Tried to send mail at: ' . date( "h:i:sa" ) . PHP_EOL );

sleep(5);
}
}


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2KZgzu2
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time