Skip to content

Commit dacd77a

Browse files
committed
increase cache timeout
1 parent dff45f0 commit dacd77a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cache/redis.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func (r *redisCache) set(key string, value []byte) error {
4242

4343
// setWithExpiry ...
4444
func (r *redisCache) setWithExpiry(key string, value []byte, expiry time.Duration) error {
45-
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
45+
ctx, cancel := context.WithTimeout(context.Background(), 200*time.Millisecond)
4646
defer cancel()
4747

4848
if err := r.client.Set(ctx, key, value, expiry).Err(); err != nil {
@@ -55,7 +55,7 @@ func (r *redisCache) setWithExpiry(key string, value []byte, expiry time.Duratio
5555

5656
// get ...
5757
func (r *redisCache) get(key string) []byte {
58-
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
58+
ctx, cancel := context.WithTimeout(context.Background(), 200*time.Millisecond)
5959
defer cancel()
6060

6161
v, err := r.client.Get(ctx, key).Result()
@@ -68,7 +68,7 @@ func (r *redisCache) get(key string) []byte {
6868

6969
// delete ...
7070
func (r *redisCache) delete(key string) error {
71-
ctx, cancel := context.WithTimeout(context.Background(), 50*time.Millisecond)
71+
ctx, cancel := context.WithTimeout(context.Background(), 200*time.Millisecond)
7272
defer cancel()
7373

7474
if err := r.client.Del(ctx, key).Err(); err != nil {

0 commit comments

Comments
 (0)