2

Laravel Artisan Schedulers configured in app/console/kernel.php are not Creating Mutex files, thus WithoutOverlapping never working. However I never get errors. Those files are supposed to be at storage/frameworks/ right?

Due to overlaps of Artisan Commands, my data geting duplicated.

Sample commands written in kernel.php :

$schedule->command('clear:logFiles')->everyMinute()->withoutOverlapping();
$schedule->command('validate:sslCommerzTransactions')->withoutOverlapping()->everyTenMinutes();
$schedule->command('send:queuedTelegramNotifications')->withoutOverlapping()->everyMinute();
$schedule->command('send:queuedRewardNotifications')->withoutOverlapping()->everyMinute();

I also made a custom function to test, but I see no mutex file:

$schedule->call(function () {
            sleep(900);
        })->name("test")->withoutOverlapping(2);

Is there anything I can do to confirm is my mutex lock files really generating/working or not?

I have configured cache table and set cache_driver to database, now I see no entries there. Though my Artisan commands are running now. Strange?

My Use case: I want to prevent overlapping. I mean if a command execution is running, Laravel should it run it until the previous execution is finished, whater timely is configured.

Please help. any info needed? I will provide.

My Laravel version is 5.8 and Cache Driver: file, db both tested

7
  • 1
    The mutex is usually implemented on the cache so the entries should popup on whatever cache driver you are using. You might be able to confirm this if you use a db cache and compare the before and after contents of the cache table. Also withoutOverlapping means that this particular scheduled command should not overlap with itself if one instance runs until it's scheduled to run again. Your wording seems to imply you're expecting the different commands to not overlap each other Commented Apr 1, 2021 at 17:54
  • @apokryfos which folder/file I should check of new entries? Als I'll try db cache Commented Apr 1, 2021 at 17:57
  • If you're using the file cache it's in storage/framework/cache but the structure there is cryptic it's not easy to find new entries. Database cache is for me the easiest because it's a matter of counting rows before and after Commented Apr 1, 2021 at 17:59
  • @apokryfos but according to stackoverflow.com/a/64151118/823454 , the files cache for this context are at storage/framework/ . Anyway my /storage/framework/cache is empty too on live server Commented Apr 1, 2021 at 18:02
  • @apokryfos I have configured cache table and set cache_driver to database, now I see no entries there. Though my Artisan commands are running now. Strange? Commented Apr 1, 2021 at 18:33

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.