mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
[Fix] 修复缓存项因key不符导致无法设置过期时间的bug;
This commit is contained in:
parent
1653372d3e
commit
fd8b38d6fd
@ -50,7 +50,7 @@ public abstract class RedisCacheStore<T> implements CacheStore<T> {
|
|||||||
Transaction multi = jedis.multi();
|
Transaction multi = jedis.multi();
|
||||||
multi.set(keyPrefix + key, parse(value));
|
multi.set(keyPrefix + key, parse(value));
|
||||||
if(expire != null) {
|
if(expire != null) {
|
||||||
multi.expireAt(key, expire.getTime());
|
multi.expireAt(keyPrefix + key, expire.getTime());
|
||||||
log.debug("已设置Key {} 的过期时间(Expire: {})", key, expire.getTime());
|
log.debug("已设置Key {} 的过期时间(Expire: {})", key, expire.getTime());
|
||||||
}
|
}
|
||||||
multi.exec();
|
multi.exec();
|
||||||
|
@ -7,6 +7,7 @@ import redis.clients.jedis.*;
|
|||||||
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public abstract class RedisPoolCacheStore<T> implements CacheStore<T> {
|
public abstract class RedisPoolCacheStore<T> implements CacheStore<T> {
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ public abstract class RedisPoolCacheStore<T> implements CacheStore<T> {
|
|||||||
Transaction multi = jedis.multi();
|
Transaction multi = jedis.multi();
|
||||||
multi.set(keyPrefix + key, parse(value));
|
multi.set(keyPrefix + key, parse(value));
|
||||||
if(expire != null) {
|
if(expire != null) {
|
||||||
multi.expireAt(key, expire.getTime());
|
multi.expireAt(keyPrefix + key, expire.getTime());
|
||||||
log.debug("已设置Key {} 的过期时间(Expire: {})", key, expire.getTime());
|
log.debug("已设置Key {} 的过期时间(Expire: {})", key, expire.getTime());
|
||||||
}
|
}
|
||||||
multi.exec();
|
multi.exec();
|
||||||
|
Loading…
Reference in New Issue
Block a user