fix: 解决SQLITE_BUSY错误处理 (#377)

This commit is contained in:
乔巴是驯鹿 2024-07-16 09:17:52 +08:00 committed by GitHub
parent 6d5d0d3370
commit bcc980d2b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View File

@ -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);
}

View File

@ -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分钟