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

Sweep: Resolve merge conflicts for PR #765: [TT-10520] Migrating from go-redis to storage library #775

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fixing GetAndDeleteSet method
  • Loading branch information
mativm02 committed Jan 24, 2024
commit feca5d209888153c322d7d455a7ae98dd687b2ce
14 changes: 11 additions & 3 deletions storage/redis.go
Original file line number Diff line number Diff line change
@@ -274,14 +274,22 @@ func (r *RedisClusterStorageManager) GetAndDeleteSet(keyName string, chunkSize i
"prefix": redisLogPrefix,
}).Debug("Fixed keyname is: ", fixedKey)

// In Pump, we used to delete a key when chunkSize was 0.
// This is not the case with Storage Library. So we need to check if chunkSize is 0 and set it to -1.
if chunkSize == 0 {
chunkSize = -1
}

result, err := r.db.list.Pop(ctx, fixedKey, chunkSize)
if err != nil {
return nil, err
}

err = r.db.kv.Expire(ctx, fixedKey, expire)
if err != nil {
return nil, err
if chunkSize != -1 {
err = r.db.kv.Expire(ctx, fixedKey, expire)
if err != nil {
return nil, err
}
}

intResult := []interface{}{}