8000 Fix supervisor reprovisioning · laravel/horizon@4b95069 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4b95069

Browse files
author
frankprins
committed
Fix supervisor reprovisioning
1 parent 363386c commit 4b95069

File tree

1 file 8000 changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/SupervisorProcess.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Closure;
66
use Laravel\Horizon\Contracts\HorizonCommandQueue;
7+
use Laravel\Horizon\Contracts\SupervisorRepository;
78
use Laravel\Horizon\MasterSupervisorCommands\AddSupervisor;
89
use Laravel\Horizon\SupervisorCommands\Terminate;
910

@@ -112,6 +113,11 @@ public function monitor()
112113
*/
113114
protected function reprovision()
114115
{
116+
if (isset($this->name)) {
117+
// When restarting, the Supervisor checks if it is already running based on this key
118+
app(SupervisorRepository::class)->forget($this->name);
119+
}
120+
115121
app(HorizonCommandQueue::class)->push(
116122
MasterSupervisor::commandQueue(),
117123
AddSupervisor::class,

0 commit comments

Comments
 (0)
0