8000 [Cache] Use SCAN instead of KEYS with Redis >= 2.8 by nicolas-grekas · Pull Request #19551 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

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

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

Merged
merged 1 commit into from
Aug 7, 2016

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
0