New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redis::pipeline calls not being instrumented #664
Comments
Hey, thanks for the heads up. Note, the following is based only on reading the Laravel code, I haven't tested anything. Looks like for pipelines, they pass the PhpRedis client instance itself to the closure, instead of the Laravel's Redis connection, which dispatches the command-executed events.
I think they could literally just replace the PhpRedis instance with Laravel's Redis connection and it should "just work", since it passes all calls to the same PhpRedis instance internally. This means simply replacing
I don't feel like working on this PR myself, but if anyone else wants to, I'm down to help. |
That is amazing. I can confirm that using Redis::get('foo'); inside the pipeline closure really works. And it still uses the pipeline method. I was afraid it would go back to sending them one by one, but it really works. Then if someone wants to do a PR to Laravel it would be even better as it will fix any code. But as I am not comfortable enough to do it I will change to using Redis::get in my code for now. |
@itsgoingd I am familiar with Laravel, PHP and I want to contribute to this, can you help me in how to start with raising a PR. |
Hello!
I noticed today that Laravel does not dispatch events when calling redis commands in Redis::pipeline(). So in my case where I use pipeline a lot to send GET commands in batch to Redis they are invisible for clockwork.
I logged an issue on laravel/framework repo:
Issue: laravel/framework#49395
But posting here just as information and maybe someone here is interested enough and skilled to help solve it. As I don't know where to start looking for adding additional triggers for Illuminate\Redis\Events\CommandExecuted event.
The text was updated successfully, but these errors were encountered: