PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, February 10, 2022

[FIXED] Laravel 5 - Task schedule withoutOverlapping not working

 February 10, 2022     laravel, laravel-5, laravel-5.1     No comments   

Issue

I try to run schedule on Laravel 5. Its work fine when I run this:

$schedule->call(function() {
   // do something here..
})->everyMinute();

But when I add withoutOverlapping(), the scheduler never run the task:

$schedule->call(function () {
   // do something here..
})->everyMinute()->name('job_name')->withoutOverlapping();

*these schedule code is written at /app/Console/Kernel.php


Solution

Delete ->everyMinute() when using ->withoutOverlapping() it will still run every minute but without overlapping.

UPDATE

Since Laravel v. 5.5+ you can specify on how many minutes must pass before the "without overlapping" lock expires.

eg. ->withoutOverlapping(10) can be used to unlock the "overlapping" when 10 minutes will pass.



Answered By - Vizjerei
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing