Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

高并发调用push时报错redis链接被另一个协程占用。支持从think-swoole的连接池里获取连接吗?或者queue类增加一个设置redis的方法,用户在调用push之前自行设置redis实例 #190

Open
note-sun opened this issue Jan 5, 2025 · 1 comment

Comments

@note-sun
Copy link

note-sun commented Jan 5, 2025

我看原始代码中,this里的redis是初始化queue的时候就设置了,导致高并发下会造成redis链接被占用。
支持从think-swoole的连接池里获取连接吗?或者queue类增加一个设置redis的方法,用户在调用push之前自行设置redis实例

 public function pushRaw($payload, $queue = null, array $options = [])
    {
        if ($this->redis->rPush($this->getQueue($queue), $payload)) {
            return json_decode($payload, true)['id'] ?? null;
        }
    }
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@note-sun and others