Skip to content
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

adjust rediscluster constant options #921

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mocxi
Copy link

@mocxi mocxi commented Nov 14, 2024

Proposed changes

update constants which we're using for the RedisCluster option were removed: phpredis/phpredis#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)
  • 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

@Geolim4
Copy link
Member

Geolim4 commented Nov 27, 2024

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

@Geolim4
Copy link
Member

Geolim4 commented Nov 27, 2024

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

@mocxi
Copy link
Author

mocxi commented Nov 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants