-
Notifications
You must be signed in to change notification settings - Fork 129
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::zRangeByScore() expects at most 4 parameters, 6 given #8
Comments
This bug likely came into being due to differences between how Redisent handles this command versus the phpredis extension. The switch from Redisent to Credis in PHP-Resque also added phpredis support (by virtue of Credis supporting the extension, where Redisent does not), and therefore all of the extension's quirks with respect to how these commands fire off. The above fix adjusts for this change in syntax, as does the referencing pull request. |
Thanks - I was thinking the same. I've got to cut an updated build of both php-resque and php-resque-scheduler, which I'll hopefully get around to this week. I'll ensure both are fully compatible with each other when I do. |
I'll be doing what I can to help, as I intend to use both in a presentation in early May. :) |
So the bug is still there in |
I don't know if it's related but I've been debugging a problem with this, in this line of php-resque-scheduler, zrangebyscore. https://github.com/chrisboulton/php-resque-scheduler/blob/master/lib/ResqueScheduler.php#L228 $items = Resque::redis()->zrangebyscore('delayed_queue_schedule', '-inf', $at, array('limit' => array(0, 1))); Removing the array('limit'...) solved my issues, that's not working for me, It also solved a problem I had with a string conversion Warning, maybe It's because my Redis version(redis-cli 2.8.17). $items = Resque::redis()->zrangebyscore('delayed_queue_schedule', '-inf', $at); I didn't work on getting only one element (replacing the limit for something solving the problem), but right now this is fine for me. |
Just commented on the BCC bundle issue you cross-posted to, but basically there's a way to fix this that either involves Credis getting fixed (seems unlikely at this ponti) or someone building a PR to check whether the PHP Redis extension is enabled, and choosing how to run this line accordingly (much more likely to be merged). It's pretty basic (in principle, anyway), but I barely have time to comment about it at the moment, so please feel free to write one up for us! |
Thanks, sorry for the cross-posting, but I thought It was relevant and didn't want to add just a link. Your comment was very insightful, I gotta think about what's the best solution and spend some time on it. |
Crashes for me with error in subj. when trying to start worker.
Changing /lib/ResqueScheduler.php line 226 to
$items = Resque::redis()->zrangebyscore('delayed_queue_schedule', '-inf', $at, array("limit" => array(0, 1)));
fixes it for me.
This also better corresponds to the docs in https://github.com/nicolasff/phpredis#zrangebyscore-zrevrangebyscore
The text was updated successfully, but these errors were encountered: