diff --git a/src/Queue/Server.php b/src/Queue/Server.php index cda2444..8e576cb 100644 --- a/src/Queue/Server.php +++ b/src/Queue/Server.php @@ -145,6 +145,7 @@ public static function setResource(string $name, callable $callback, array $inje public function shutdown(): Hook { $hook = new Hook(); + $hook->groups(['*']); $this->shutdownHooks[] = $hook; return $hook; } @@ -174,6 +175,7 @@ public function stop(): self public function init(): Hook { $hook = new Hook(); + $hook->groups(['*']); $this->initHooks[] = $hook; return $hook; } @@ -298,6 +300,8 @@ public function start(): self */ $this->adapter->connection->decrement("{$this->adapter->namespace}.stats.{$this->adapter->queue}.processing"); } + + $this->resources = []; } }); @@ -318,6 +322,7 @@ public function start(): self public function workerStart(): Hook { $hook = new Hook(); + $hook->groups(['*']); $this->workerStartHook = $hook; return $hook; } @@ -413,6 +418,7 @@ protected function validate(string $key, array $param, mixed $value): void public function error(): Hook { $hook = new Hook(); + $hook->groups(['*']); $this->errorHooks[] = $hook; return $hook; }