Skip to content

Commit e365c08

Browse files
authored
fix: schedule:test on commands using runInBackground (#54321)
Force to run the selected command in the foreground. The `artisan schedule:test` command exited immediately after invocation and the selected command did not start if it uses `->runInBackground()`. If `->withoutOverlapping()` is used too, the mutex would not be removed and blocks any further execution without any user facing notice.
1 parent 066b740 commit e365c08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Illuminate/Console/Scheduling/ScheduleTestCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ public function handle(Schedule $schedule)
7676
$description = sprintf(
7777
'Running [%s]%s',
7878
$command,
79-
$event->runInBackground ? ' in background' : '',
79+
$event->runInBackground ? ' normally in background' : '',
8080
);
8181

82+
$event->runInBackground = false;
83+
8284
$this->components->task($description, fn () => $event->run($this->laravel));
8385

8486
if (! $event instanceof CallbackEvent) {

0 commit comments

Comments
 (0)