laravel/lumen-framework

Kernel schedule runInBackground() is always running pingOnFailure()

cloetensbrecht opened this issue · 1 comments

  • Lumen Version: 5.8.12
  • Laravel Version: 5.8.*
  • PHP Version: 7.4.20

Description:

When running a scheduled command with runInBackground, the pingOnFailure method is always fired.
When you run the below code with php artisan schedule:run you will only see the before, but the pingOnFailure is fired too.
When you remove the runInBackground it will fire the onSuccess which I gave a 404 header response to visually see the response in the console. When the runInBackground is added you don't receive the 500 response, but when testing it with a real service like https://healthchecks.io/ it receives the /failure call.

Steps To Reproduce:

protected function schedule(Schedule $schedule)
{
        $schedule
            ->command('-V')
            ->before(function() {
                echo 'before'.PHP_EOL;
            })
            ->after(function() {
                echo 'after'.PHP_EOL;
            })
            ->onSuccess(function () {
                echo 'success'.PHP_EOL;
            })
            ->onFailure(function () {
                echo 'failure'.PHP_EOL;
            })
            ->pingBefore('https://mock.codes/200')
            ->pingOnSuccess('https://mock.codes/404')
            ->pingOnFailure('https://mock.codes/500')
            ->runInBackground()
            ->everyMinute();
}

Hey there,

Unfortunately we don't support this version anymore. Please check out our support policy on which versions we are currently supporting. Can you please try to upgrade to the latest version and see if your problem persists? If so, please open up a new issue and we'll help you out.

Thanks!