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

[5.3] avoid unexpected redis connection problems during tagged flush #16568

Merged
merged 2 commits into from
Nov 28, 2016

Conversation

martianoff
Copy link
Contributor

If you have a lot of keys inside tag like 1 million you will get following error on "flush"

 [Predis\Connection\ConnectionException]
  Error while writing bytes to the server.

This small fix can solve it.

@martianoff martianoff changed the title - avoid unexpected connection problems during tagged flush [5.3] avoid unexpected connection problems during tagged flush Nov 28, 2016
@martianoff martianoff changed the title [5.3] avoid unexpected connection problems during tagged flush [5.3] avoid unexpected redis connection problems during tagged flush Nov 28, 2016
@@ -146,7 +146,9 @@ protected function deleteValues($referenceKey)
$values = array_unique($this->store->connection()->smembers($referenceKey));

if (count($values) > 0) {
call_user_func_array([$this->store->connection(), 'del'], $values);
foreach (array_chunk($values, 1000) as $values_chunk) {
Copy link
Member

Choose a reason for hiding this comment

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

we don't use snake case for variables please

Copy link
Member

Choose a reason for hiding this comment

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

maybe 1000 is too small a value here?

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.

None yet

3 participants