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

fix(chore): allow to delete keys by regex #526

Merged
merged 2 commits into from
Jun 23, 2024

Conversation

HobMartin
Copy link
Contributor

@HobMartin HobMartin commented Jun 20, 2024

After providing some testing of removing keys by regex from Redis storage using Souin API, I saw that keys still exist, and nothing happened after calling the PURGE request with regex. But the PURGE request to the /flush endpoint works.

So I debugged the purge method and found that it deleted keys only by providing a whole key ID. So I added checking if the key is the regex thanDelete method in Souin API should call DeleteMany instead of Delete.

Related to #417

Copy link

netlify bot commented Jun 20, 2024

Deploy Preview for teal-sprinkles-4c7f14 canceled.

Name Link
🔨 Latest commit dccd9d7
🔍 Latest deploy log https://app.netlify.com/sites/teal-sprinkles-4c7f14/deploys/66785a3c87ec5200089c4c40

pkg/api/souin.go Outdated Show resolved Hide resolved
@HobMartin HobMartin requested a review from darkweak June 23, 2024 14:18
@darkweak
Copy link
Owner

@HobMartin can you rebase to be sure every tests are ok please? I fixed the Etcd version in the GitHub actions.

@HobMartin HobMartin force-pushed the fix/chore/purge-keys-by-regex branch from 40059a2 to dccd9d7 Compare June 23, 2024 17:24
@darkweak darkweak merged commit dd172cb into darkweak:master Jun 23, 2024
20 of 21 checks passed
@darkweak
Copy link
Owner

Thank you @HobMartin 🙏

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