phpfastcache icon indicating copy to clipboard operation
phpfastcache copied to clipboard

adjust rediscluster constant options

Open mocxi opened this issue 1 year ago • 4 comments

Proposed changes

update constants which we're using for the RedisCluster option were removed: https://github.com/phpredis/phpredis/issues/2262

Types of changes

What types of changes does your code introduce to Phpfastcache? Put an x in the boxes that apply

  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] Improvement (non-breaking change which improves an existing code/behavior)
  • [x] Deprecated third party dependency update
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation/Typo/Resource update that does not involve any code modification

Agreement

I have read the CONTRIBUTING and CODING GUIDELINE docs

Further comments

N/A

mocxi avatar Nov 14 '24 07:11 mocxi

Nice catch, thanks ! (I will make a new release by the end of week)

Geolim4 avatar Nov 27 '24 19:11 Geolim4

Can you run the tests locally and tell me if they work successfully ?

Geolim4 avatar Nov 27 '24 19:11 Geolim4

Hello, yes, it worked successfully at my local, here is my code:

    /**
     * Check RedisCluster working
     */
    #[Group('skip')]
    #[Group('rawconfig')]
    public function testRawConfig()
    {
        $config = new \Phpfastcache\Drivers\Rediscluster\Config();
        $config->addCluster('redis-node-creator:6379');
        $cache = CacheManager::getInstance('RedisCluster', $config);

        $testString = 'xxx';
        $cacheKey = sha1('test');
        $cacheString = $cache->getItem($cacheKey)->set($testString);
        $cacheString->expiresAfter(5);
        $cache->save($cacheString);

        $value = $cache->getItem($cacheKey)->get();
        $this->assertEquals($value, $testString);
    }

about the failed test above I see the error:

Rediscluster failed to connect with the following error message: "Couldn't map cluster keyspace using any provided seed"

I guess the issue is that the RedisCluster server is not working properly.

mocxi avatar Nov 28 '24 03:11 mocxi

Hi @mocxi can you fix the CI errors + add check of constant before using them to keep backward compatibility please ?

Thank you !

Geolim4 avatar Mar 02 '25 13:03 Geolim4