php-resque icon indicating copy to clipboard operation
php-resque copied to clipboard

allow users to use a credis native setup

Open scones opened this issue 7 years ago • 3 comments

... instead of testing an unused variable

this change allows us to pass a credis_cluster object as $server and thus use a preconfigured sentinel setup. and it is already tested in production

best regards.

scones avatar Jul 06 '18 10:07 scones

Seeing as the current code lets you do the same exact thing by passing the object as the third argument instead of the first... Without modifications... This change is a backwards compatibility break, and doesn't actually add anything that isn't already there, so it probably won't be merged.

danhunsaker avatar Jul 06 '18 14:07 danhunsaker

The only place i can locate, where Resque::$redis is assigned, seems to be here: https://github.com/chrisboulton/php-resque/blob/968b7e6a307a2079051dfc571d2fc2be0546209f/lib/Resque.php#L62 (and maybe two lines above that).

You might notice the apparent lack of a third argument.

So yes, the current implementation of Resque_Redis does allow for a native setup, but the current implementation of Resque does not.

But i am always open for a configuration example with the current release that can use a sentinel setup.

scones avatar Jul 08 '18 11:07 scones

Let me rephrase, then. If the issue is that nothing is actually passing the third argument to the Resque_Redis constructor, then the correct fix is to update the calling code to make use of this parameter, rather than negate its very existence by changing the one pair of lines that uses it.

danhunsaker avatar Jul 08 '18 12:07 danhunsaker