Skip to content

Conversation

@byjg
Copy link
Owner

@byjg byjg commented Dec 20, 2025

  • What is the purpose of this pull request?

    • Optimizes the clear() method in RedisCacheEngine by using the SCAN command for improved performance.
    • Adds a Docker service run configuration to facilitate testing.
  • Why is this necessary?

    • To enhance the performance of the clear() operation in the Redis Cache Engine.
    • To simplify and streamline the test setup process.
  • Unit tests

  • Integration tests

  • Documentation

…ed performance; add Docker service run configuration for tests.
$this->delete($matches['key']);
$iterator = null;
do {
$keys = $this->redis->scan($iterator, 'cache:*');

Check notice

Code scanning / Psalm

PossiblyNullReference Note

Cannot call method scan on possibly null value
Copy link
Owner Author

Choose a reason for hiding this comment

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

I need to create a variable iterator because it gets the references for the next part, if available.

The signature of scan method is:

scan(null|int|string $iterator, string|null $pattern = null, int $count = 0, string|null $type = null)

With is perfectly acceptable set null in $iterator.

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