From 682f7d7af3ea9651e23e1866a5431f69b9bf4118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 16 Nov 2022 19:34:25 +0000 Subject: [PATCH 1/2] Reset resources after job --- src/Queue/Server.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Queue/Server.php b/src/Queue/Server.php index cda2444..728b051 100644 --- a/src/Queue/Server.php +++ b/src/Queue/Server.php @@ -298,6 +298,8 @@ public function start(): self */ $this->adapter->connection->decrement("{$this->adapter->namespace}.stats.{$this->adapter->queue}.processing"); } + + $this->resources = []; } }); From 4b36b0756c4e8db553ef54c48190dd17d4152a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Wed, 16 Nov 2022 19:46:26 +0000 Subject: [PATCH 2/2] Add groups wildcard --- src/Queue/Server.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Queue/Server.php b/src/Queue/Server.php index 728b051..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; } @@ -320,6 +322,7 @@ public function start(): self public function workerStart(): Hook { $hook = new Hook(); + $hook->groups(['*']); $this->workerStartHook = $hook; return $hook; } @@ -415,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; }