Skip to content

Commit

Permalink
rename batch to count
Browse files Browse the repository at this point in the history
  • Loading branch information
blight19 committed Mar 20, 2024
1 parent f286da4 commit 55b41f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/client/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ func (r *Redis) Close() {

/* Commands */

func (r *Redis) Scan(cursor uint64, batch string) (newCursor uint64, keys []string) {
r.Send("scan", strconv.FormatUint(cursor, 10), "count", batch)
func (r *Redis) Scan(cursor uint64, count string) (newCursor uint64, keys []string) {
r.Send("scan", strconv.FormatUint(cursor, 10), "count", count)
reply, err := r.Receive()
if err != nil {
log.Panicf(err.Error())
Expand Down
6 changes: 3 additions & 3 deletions internal/reader/scan_standalone_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type ScanReaderOptions struct {
KSN bool `mapstructure:"ksn" default:"false"`
DBS []int `mapstructure:"dbs"`
PreferReplica bool `mapstructure:"prefer_replica" default:"false"`
Batch int `mapstructure:"batch" default:"2048"`
Count int `mapstructure:"count" default:"2048"`
}

type dbKey struct {
Expand Down Expand Up @@ -132,10 +132,10 @@ func (r *scanStandaloneReader) scan() {
}

var cursor uint64 = 0
batch := strconv.Itoa(r.opts.Batch)
count := strconv.Itoa(r.opts.Count)
for {
var keys []string
cursor, keys = c.Scan(cursor, batch)
cursor, keys = c.Scan(cursor, count)
for _, key := range keys {
r.keyQueue.Put(dbKey{dbId, key}) // pass value not pointer
}
Expand Down

0 comments on commit 55b41f5

Please sign in to comment.