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(multiple): march 2025 wave #604

Merged
merged 4 commits into from
Mar 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/storage/defaultProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ func (provider *Default) DeleteMany(key string) {
re, e := regexp.Compile(key)

if e != nil {
return
provider.logger.Infof("Failed to compile key %s, %v", key, e)
}

provider.m.Range(func(key, _ any) bool {
if re.MatchString(key.(string)) {
provider.m.Range(func(current, _ any) bool {
if (re != nil && re.MatchString(current.(string))) || strings.HasPrefix(current.(string), key) {
provider.m.Delete(key)
}

Expand Down
4 changes: 3 additions & 1 deletion plugins/caddy/httpcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ func (s *SouinCaddyMiddleware) FromApp(app *SouinApp) error {
}

if app.DefaultCache.GetTTL() == 0 {
return nil
if s.Configuration.DefaultCache.GetTTL() == 0 {
app.DefaultCache.TTL = configurationtypes.Duration{Duration: 120 * time.Second}
}
}

s.Configuration.API = app.API
Expand Down
2 changes: 1 addition & 1 deletion plugins/go-zero/examples/internal/handler/routes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions plugins/traefik/override/storage/cacheProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,11 @@ func (provider *Cache) Delete(key string) {

// DeleteMany method will delete the responses in Cache provider if exists corresponding to the regex key param
func (provider *Cache) DeleteMany(key string) {
re, e := regexp.Compile(key)
re, _ := regexp.Compile(key)

if e != nil {
return
}

provider.Cache.Range(func(k, _ interface{}) bool {
if re.MatchString(k.(string)) {
provider.Delete(k.(string))
provider.Cache.Range(func(current, _ any) bool {
if (re != nil && re.MatchString(current.(string))) || strings.HasPrefix(current.(string), key) {
provider.Delete(current.(string))
}
return true
})
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions plugins/tyk/override/storage/cacheProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,10 @@ func (provider *Cache) Delete(key string) {

// DeleteMany method will delete the responses in Cache provider if exists corresponding to the regex key param
func (provider *Cache) DeleteMany(key string) {
re, e := regexp.Compile(key)

if e != nil {
return
}
re, _ := regexp.Compile(key)

for k := range provider.Items() {
if re.MatchString(k) {
if (re != nil && re.MatchString(k)) || strings.HasPrefix(k, key) {
provider.Delete(k)
}
}
Expand Down
Loading