Skip to content

Commit 79fbf4a

Browse files
authored
delegate defer to run method (#52807)
1 parent 881b28d commit 79fbf4a

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/Illuminate/Concurrency/ProcessDriver.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,7 @@ public function run(Closure|array $tasks): array
5959
*/
6060
public function defer(Closure|array $tasks): DeferredCallback
6161
{
62-
$php = $this->phpBinary();
63-
$artisan = $this->artisanBinary();
64-
65-
return defer(function () use ($tasks, $php, $artisan) {
66-
foreach (Arr::wrap($tasks) as $task) {
67-
$this->processFactory->path(base_path())->env([
68-
'LARAVEL_INVOKABLE_CLOSURE' => serialize(new SerializableClosure($task)),
69-
])->run([
70-
$php,
71-
$artisan,
72-
'invoke-serialized-closure 2>&1 &',
73-
]);
74-
}
75-
});
62+
return defer(fn () => $this->run($tasks));
7663
}
7764

7865
/**

0 commit comments

Comments
 (0)