From 1911a5adb8ba80303c601e08e1e3678e8b522e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radam=C3=A9s=20Roriz?= Date: Thu, 25 Aug 2022 16:58:27 -0300 Subject: [PATCH] ref: Stop any worker if the hook raise an error --- lib/sneakers/workergroup.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/sneakers/workergroup.rb b/lib/sneakers/workergroup.rb index fe6dd00a..0e16b9a1 100644 --- a/lib/sneakers/workergroup.rb +++ b/lib/sneakers/workergroup.rb @@ -9,11 +9,15 @@ def initialize def before_fork fbefore = Sneakers::CONFIG[:hooks][:before_fork] fbefore.call if fbefore + rescue => e + stop end def after_fork # note! this is not Serverengine#after_start, this is ours! fafter = Sneakers::CONFIG[:hooks][:after_fork] fafter.call if fafter + rescue => e + stop end def run