Skip to content

Commit

Permalink
Ensure event is raised before exiting the process (#1341)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshulse committed Oct 27, 2023
1 parent 3153003 commit 6e2b0bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Listeners/MonitorMasterSupervisorMemory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public function handle(MasterSupervisorLooped $event)
$master = $event->master;

if ($master->memoryUsage() > config('horizon.memory_limit', 64)) {
$master->terminate(12);

event(new MasterSupervisorOutOfMemory($master));

$master->terminate(12);
}
}
}
4 changes: 2 additions & 2 deletions src/Listeners/MonitorSupervisorMemory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public function handle(SupervisorLooped $event)
$supervisor = $event->supervisor;

if ($supervisor->memoryUsage() > $supervisor->options->memory) {
$supervisor->terminate(12);

event(new SupervisorOutOfMemory($supervisor));

$supervisor->terminate(12);
}
}
}

0 comments on commit 6e2b0bb

Please sign in to comment.