1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-28 06:42:00 +03:00

Add ctx as first arg

This commit is contained in:
Vladimir Mihailenco
2020-03-11 16:26:42 +02:00
parent 64bb0b7f3a
commit f5593121e0
36 changed files with 3200 additions and 2970 deletions

View File

@ -1,6 +1,7 @@
package redis
import (
"context"
"sync"
)
@ -21,7 +22,7 @@ func (it *ScanIterator) Err() error {
}
// Next advances the cursor and returns true if more values can be read.
func (it *ScanIterator) Next() bool {
func (it *ScanIterator) Next(ctx context.Context) bool {
it.mu.Lock()
defer it.mu.Unlock()
@ -49,7 +50,7 @@ func (it *ScanIterator) Next() bool {
it.cmd.args[2] = it.cmd.cursor
}
err := it.cmd.process(it.cmd)
err := it.cmd.process(ctx, it.cmd)
if err != nil {
return false
}