Closed alexsmirnovdotcom closed 9 months ago
Hey there, thanks for reporting this issue.
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here?
Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
laravel new bug-report --github="--public"
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
Hi!
I make repository to reproduce bug in one command. (This is clear laravel installation with only one added queued TestJob) https://github.com/alexsmirnovdotcom/laravel-cron-bug
docker-compose build && docker-compose down --remove-orphans && docker-compose up -d
.After launching the Docker containers, the Laravel application will start, and a test queued job will be executed in the schedule.
All logs are located in the standard Laravel logs folder:
{path_to_project}/laravel/storage/logs/laravel.log
(for Laravel logs).{path_to_project}/laravel/storage/logs/cron.log
(for Cron logs).A portion of these logs is also available in the repository for easy access without the need to run the application.
In \Illuminate\Console\Scheduling\ScheduleRunCommand::repeatEvents()
if i change condition of while loop from
Date::now()->lte($this->startedAt->endOfMinute())
to
Date::now()->lte($this->startedAt->endOfMinute()->subSeconds(20))
It works perfect...
I was unable to identify why cron skips running the php artisan schedule:run
command.
It is possible that the execution of the previous command does not have time to complete before trying to start a new one.
But as far as I know, cron does not check this and must run the command even if the previous one has not completed yet...
Hi there. I was not able to reproduce this on a local Laravel app with the latest version. Why this isn't working for you in your Docker setup, I do not know. But this unfortunately is beyond the support we can offer here. Please try a support channel:
Laravel Version
10.4.1
PHP Version
8.2
Database Driver & Version
No response
Description
In last versions of laravel 10 was added sub-minute intervals. But i have strange behavior of runnig of cron task. All works in Docker with docker-compose. Cron works in separate from Laravel container. I have no any errors in logs.
Crontab file:
\App\Console\Kernel.php:
SyncChangesFrom1C is a queued job.
handle
method is empty.Logs of Laravel:
Logs of Cron:
If i`m change to everyMinute:
It work perfect, and run every minute.
Why it skip a minute before new run if used sub-minutes interval?
Steps To Reproduce
-