Skip to content

Commit 76e49c8

Browse files
committed
Bug fix: Resolve the issue where SetJSON fails to set when the expiration time is greater than 0.
1 parent 163a4d1 commit 76e49c8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

redis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ func (m *Manager) SetJSON(key string, value any, expiration int) error {
13551355
}
13561356

13571357
if expiration > 0 {
1358-
_, err = conn.Do("SETEX", m.Prefix+key, expiration, jsonData)
1358+
_, err = conn.Do("SET", m.prefixKey(key), jsonData, "EX", expiration)
13591359
} else {
13601360
_, err = conn.Do("SET", m.Prefix+key, jsonData)
13611361
}

0 commit comments

Comments
 (0)