Skip to content

Commit

Permalink
Fixup Redis lock context compilation error
Browse files Browse the repository at this point in the history
Related to #793; see #803.
  • Loading branch information
agcom committed Mar 28, 2024
1 parent 0c29c70 commit a11cb2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion v2/locks/redis/redis.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package redis

import (
"context"
"errors"
"strconv"
"strings"
Expand Down Expand Up @@ -64,7 +65,8 @@ func (r Lock) LockWithRetries(key string, unixTsToExpireNs int64) error {
func (r Lock) Lock(key string, unixTsToExpireNs int64) error {
now := time.Now().UnixNano()
expiration := time.Duration(unixTsToExpireNs + 1 - now)
ctx := r.rclient.Context()
// ctx := r.rclient.Context()
ctx := context.Background()

success, err := r.rclient.SetNX(ctx, key, unixTsToExpireNs, expiration).Result()
if err != nil {
Expand Down

0 comments on commit a11cb2d

Please sign in to comment.