Skip to content

Conversation

@nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Aug 5, 2016

Q A
Branch? 3.1
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

With #19521 coming, clearing cache keys by prefix is going to be used a lot more often.
Time to fix Redis cache clearing.

@nicolas-grekas nicolas-grekas merged commit aadeb11 into symfony:3.1 Aug 7, 2016
nicolas-grekas added a commit that referenced this pull request Aug 7, 2016
…s-grekas)

This PR was merged into the 3.1 branch.

Discussion
----------

[Cache] Use SCAN instead of KEYS with Redis >= 2.8

| Q             | A
| ------------- | ---
| Branch?       | 3.1
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

With #19521 coming,  clearing cache keys by prefix is going to be used a lot more often.
Time to fix Redis cache clearing.

Commits
-------

aadeb11 [Cache] Use SCAN instead of KEYS with Redis >= 2.8
@nicolas-grekas nicolas-grekas deleted the cache-redis-clear branch August 7, 2016 15:23
$info = $host->info('Server');
$info = isset($info['Server']) ? $info['Server'] : $info;

if (!version_compare($info['redis_version'], '2.8', '>=')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for curiosity, can't you do: version_compare($info['redis_version'], '2.8', '<') ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the same yes

@fabpot fabpot mentioned this pull request Sep 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants