Skip to content

Commit

Permalink
Fix supervisor reprovisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinsFrank committed Jun 21, 2023
1 parent 363386c commit f68f79d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SupervisorProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Closure;
use Laravel\Horizon\Contracts\HorizonCommandQueue;
use Laravel\Horizon\Contracts\SupervisorRepository;
use Laravel\Horizon\MasterSupervisorCommands\AddSupervisor;
use Laravel\Horizon\SupervisorCommands\Terminate;

Expand Down Expand Up @@ -112,6 +113,11 @@ public function monitor()
*/
protected function reprovision()
{
if (isset($this->name)) {
// When restarting, the Supervisor checks if it is already running based on this key
app(SupervisorRepository::class)->forget($this->name);
}

app(HorizonCommandQueue::class)->push(
MasterSupervisor::commandQueue(),
AddSupervisor::class,
Expand Down

0 comments on commit f68f79d

Please sign in to comment.