File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -268,16 +268,18 @@ func (p *Plugin) invalidateDML(ctx context.Context, query string) {
268268 // TODO: This is not efficient. We should be able to invalidate the cache
269269 // for a specific key instead of invalidating the entire table.
270270 pipeline := p .RedisClient .Pipeline ()
271+ var cursor uint64
271272 for {
272- scanResult := p .RedisClient .Scan (ctx , 0 , table + ":*" , p .ScanCount )
273+ scanResult := p .RedisClient .Scan (ctx , cursor , table + ":*" , p .ScanCount )
273274 if scanResult .Err () != nil {
274275 CacheMissesCounter .Inc ()
275276 p .Logger .Debug ("Failed to scan keys" , "error" , scanResult .Err ())
276277 break
277278 }
278279
279280 // Per each key, delete the cache entry and the table cache key itself.
280- keys , cursor := scanResult .Val ()
281+ var keys []string
282+ keys , cursor = scanResult .Val ()
281283 for _ , tableKey := range keys {
282284 // Invalidate the cache for the table.
283285 cachedRespnseKey := strings .TrimPrefix (tableKey , table + ":" )
You can’t perform that action at this time.
0 commit comments