From 6e2b0bb3f8c5b653e8e3ba15661caea6d9613c31 Mon Sep 17 00:00:00 2001 From: James Hulse Date: Sat, 28 Oct 2023 02:58:13 +1300 Subject: [PATCH] Ensure event is raised before exiting the process (#1341) --- src/Listeners/MonitorMasterSupervisorMemory.php | 4 ++-- src/Listeners/MonitorSupervisorMemory.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Listeners/MonitorMasterSupervisorMemory.php b/src/Listeners/MonitorMasterSupervisorMemory.php index 14e92e42..ebf1582f 100644 --- a/src/Listeners/MonitorMasterSupervisorMemory.php +++ b/src/Listeners/MonitorMasterSupervisorMemory.php @@ -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); } } } diff --git a/src/Listeners/MonitorSupervisorMemory.php b/src/Listeners/MonitorSupervisorMemory.php index 811e2063..605c5627 100644 --- a/src/Listeners/MonitorSupervisorMemory.php +++ b/src/Listeners/MonitorSupervisorMemory.php @@ -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); } } }