mirror of
https://github.com/oddfar/campus-imaotai.git
synced 2026-06-03 21:00:53 +08:00
fix: 解决SQLITE_BUSY错误处理 (#377)
This commit is contained in:
parent
6d5d0d3370
commit
bcc980d2b2
@ -179,7 +179,7 @@ public class RedisCache {
|
||||
*/
|
||||
public <T> long setCacheList(final String key, final List<T> dataList) {
|
||||
if (redisDisabled) {
|
||||
dictLocalCache.put(key, JSON.toJSONString(dataList));
|
||||
dictLocalCache.put(key, dataList);
|
||||
return dataList.size();
|
||||
}
|
||||
Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
|
||||
@ -211,8 +211,7 @@ public class RedisCache {
|
||||
*/
|
||||
public <T> List<T> getCacheList(final String key) {
|
||||
if (redisDisabled) {
|
||||
Object obj = dictLocalCache.get(key);
|
||||
return (List<T>) obj;
|
||||
return (List<T>) dictLocalCache.get(key);
|
||||
}
|
||||
return redisTemplate.opsForList().range(key, 0, -1);
|
||||
}
|
||||
|
||||
@ -35,12 +35,12 @@ spring:
|
||||
data-source-properties:
|
||||
journal_mode: WAL
|
||||
cache: shared
|
||||
# 最大连接池数量
|
||||
maxPoolSize: 20
|
||||
# 最大连接池数量(解决SQLITE_BUSY错误处理,SQLite 由于是文件数据库,不支持并发,最大线程数改为1,如果使用MySQL数据库,这里改为自定义数量)
|
||||
maxPoolSize: 1
|
||||
# 最小空闲线程数量
|
||||
minIdle: 10
|
||||
minIdle: 1
|
||||
# 配置获取连接等待超时的时间
|
||||
connectionTimeout: 30000
|
||||
connectionTimeout: 300000
|
||||
# 校验超时时间
|
||||
validationTimeout: 5000
|
||||
# 空闲连接存活最大时间,默认10分钟
|
||||
|
||||
Loading…
Reference in New Issue
Block a user