Skip to content

adjust rediscluster constant options#921

Open
mocxi wants to merge 1 commit into
TruCopilot:masterfrom
mocxi:remove_deprecated_redis_cluster_constant
Open

adjust rediscluster constant options#921
mocxi wants to merge 1 commit into
TruCopilot:masterfrom
mocxi:remove_deprecated_redis_cluster_constant

Conversation

@mocxi

@mocxi mocxi commented Nov 14, 2024

Copy link
Copy Markdown

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

Geolim4 commented Nov 27, 2024

Copy link
Copy Markdown
Member

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

@Geolim4

Geolim4 commented Nov 27, 2024

Copy link
Copy Markdown
Member

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

@mocxi

mocxi commented Nov 28, 2024

Copy link
Copy Markdown
Author

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.

@Geolim4

Geolim4 commented Mar 2, 2025

Copy link
Copy Markdown
Member

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

Thank you !

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