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

Tuesday, May 17, 2022

[FIXED] Why did Artisan Schedule ignore "withoutOverlapping"?

 May 17, 2022     cron, laravel, laravel-artisan, mysql, php     No comments   

Issue

In my Laravel Kernel I have the following schedule function:

   $schedule->command('import:currencyrate')->everyMinute()->withoutOverlapping(1)->emailOutputOnFailure('contact@website.com');
    $schedule->command('import:token_data')->everyFiveMinutes()->withoutOverlapping(1)->emailOutputOnFailure('contact@website.com');
    $schedule->command('import:nft_data')->everyTenMinutes()->withoutOverlapping(1);

This usually works without any issues for the last year. But for the last few days, my server crashes 1-2 times a day, due to tasks that don't complete & overlap:

enter image description here

How is this possible? I use withoutOverlapping, shouldn't that stop the same task to run multiple times?


Solution

you have written ->withoutOverlapping(1) that means after 1 min of lock time your task will run again. Click here to see the laravel documentation. Try ->withoutOverlapping() and check.



Answered By - S_B
Answer Checked By - Pedro (PHPFixing Volunteer)
  • 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