Skip to content

Commit 3b5f250

Browse files
committed
optimize
1 parent 7bf2015 commit 3b5f250

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Driver/RedisQueue.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ public function __construct(Config|ClusterConfig $config)
3131

3232
public function init(string $topicName, ?string $nodeId): bool
3333
{
34-
if(!$this->hasInit){
35-
$this->hasInit = true;
34+
if($this->hasInit){
35+
return true;
3636
}
37+
$this->hasInit = true;
3738
$this->queueName = $topicName;
3839
$this->pool = new _Pool($this->config);
3940
return true;
@@ -172,6 +173,8 @@ public function flush():bool
172173

173174
public function __clone()
174175
{
175-
176+
if($this->pool){
177+
$this->pool = clone $this->pool;
178+
}
176179
}
177180
}

0 commit comments

Comments
 (0)