Skip to content

Commit

Permalink
remove async method
Browse files Browse the repository at this point in the history
  • Loading branch information
morkid committed Nov 22, 2022
1 parent a186a3c commit 369b972
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions paginate.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ func (p Pagination) ClearCache(keyPrefixes ...string) {
if len(keyPrefixes) > 0 && nil != p.Config && nil != p.Config.CacheAdapter {
adapter := *p.Config.CacheAdapter
for i := range keyPrefixes {
go func(adapter gocache.AdapterInterface, keyPrefix string) {
if err := adapter.ClearPrefix(keyPrefix); nil != err {
log.Println(err)
}
}(adapter, keyPrefixes[i])
if err := adapter.ClearPrefix(keyPrefixes[i]); nil != err {
log.Println(err)
}
}
}
}
Expand All @@ -70,11 +68,9 @@ func (p Pagination) ClearCache(keyPrefixes ...string) {
func (p Pagination) ClearAllCache() {
if nil != p.Config && nil != p.Config.CacheAdapter {
adapter := *p.Config.CacheAdapter
go func(adapter gocache.AdapterInterface) {
if err := adapter.ClearAll(); nil != err {
log.Println(err)
}
}(adapter)
if err := adapter.ClearAll(); nil != err {
log.Println(err)
}
}
}

Expand Down

0 comments on commit 369b972

Please sign in to comment.