Skip to content

Commit f2db8f9

Browse files
authored
Custom worker fix (vyuldashev#320)
1 parent 156fdcf commit f2db8f9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Queue/Connectors/RabbitMQConnector.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,10 @@ public function connect(array $config): Queue
8686
return new HorizonRabbitMQQueue($context, $config);
8787
}
8888

89-
if ($worker instanceof RabbitMQQueue) {
90-
return new $worker($context, $config);
89+
$customWorker = new $worker($context, $config);
90+
91+
if ($customWorker instanceof RabbitMQQueue) {
92+
return $customWorker;
9193
}
9294

9395
throw new InvalidArgumentException('Invalid worker.');

0 commit comments

Comments
 (0)