mercredi 12 juillet 2017

Laravel withoutoverlapping() isn't running even if name is used for task

I am trying to configure laravel task schedular , I am priting numbers from 0 to infinity to just test why withoutoverlapping() isn't working.

My code :

protected function schedule(Schedule $schedule)
{
    $schedule->call(function (Request $request) 
    {
         $i=0;

         while(1)
         {
               echo $i."-";
               sleep(3);
               $i++;
         }
    })->everyMinute()->name('mailfetch')->withoutOverlapping();
}

If my schedular is running and I am trying to run another schedular then that should not execute, but in my case both schedulars start running and start priting data.

Output:

enter image description here

Everything seems to be correct but dont' know why is that happening.



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

Aucun commentaire:

Enregistrer un commentaire