Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Commit e65569b

Browse files
committed
fix redis cache expiration
1 parent 39fb9a3 commit e65569b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cache.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"github.com/go-redis/redis/v8"
88
"github.com/kataras/iris/v12"
9+
"time"
910
)
1011

1112
var cache *redis.Client
@@ -29,7 +30,7 @@ func SetupCache() {
2930
}
3031

3132
func SetCache(ctx iris.Context, key string, value string) error {
32-
return cache.Set(ctx.Request().Context(), key, value, conf.Redis.Expiration).Err()
33+
return cache.Set(ctx.Request().Context(), key, value, conf.Redis.Expiration*time.Second).Err()
3334
}
3435

3536
func GetCache(ctx iris.Context, key string) (val string, ok bool) {

0 commit comments

Comments
 (0)