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

[8.x] Improve PhpRedis flushing #40544

Merged
merged 6 commits into from
Jan 22, 2022

Conversation

tillkruss
Copy link
Contributor

@tillkruss tillkruss commented Jan 21, 2022

Followup to #40446 to make PhpRedis connections behave like Predis as usual.

  • Move cluster flush logic into PhpRedisClusterConnection
  • Added support for ASYNC modifier to both PhpRedis flushdb() methods
  • PhpRedisClusterConnection::flushdb() will now fire CommandExecuted events as well

@tillkruss tillkruss changed the title Improve redis cluster flush [8.x] Improve PhpRedis flushing Jan 21, 2022
@tillkruss tillkruss marked this pull request as ready for review January 21, 2022 18:15
@driesvints
Copy link
Member

I know nothing of the internals here so I'm not the right person to review this.

@taylorotwell taylorotwell merged commit 47704e7 into laravel:8.x Jan 22, 2022

foreach ($this->client->_masters() as $master) {
$this->client->flushDb($master);
if (strtoupper((string) $arguments[0] ?? null) === 'ASYNC') {
Copy link
Contributor

@TheLevti TheLevti Jan 23, 2022

Choose a reason for hiding this comment

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

This causes a lot of tests to fail for me with an index access that does not exist.

It should be if (strtoupper((string) ($arguments[0] ?? null)) === 'ASYNC') {

Copy link
Contributor

@TheLevti TheLevti Jan 23, 2022

Choose a reason for hiding this comment

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

As sometimes there are no arguments at all and the string cast takes precedence.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll make a PR with tests and the changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #40571

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.

5 participants