Skip to content

Commit

Permalink
1、优化NullValue的配置
Browse files Browse the repository at this point in the history
2、增加注释
  • Loading branch information
chenchuangkun committed Nov 7, 2024
1 parent f2c6152 commit 500c738
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static class CacheConfig implements Config {
private boolean allowNullValues = true;

/**
* NullValue的过期时间,单位秒,默认30秒
* NullValue的过期时间,单位秒,默认60秒
* 用于淘汰NullValue的值
* 注:当缓存项的过期时间小于该值时,则NullValue不会淘汰
*/
Expand All @@ -91,7 +91,7 @@ public static class CacheConfig implements Config {
* NullValue 的最大数量,防止出现内存溢出
* 注:当超出该值时,会在下一次刷新缓存时,淘汰掉NullValue的元素
*/
private long nullValueMaxSize = 3000;
private long nullValueMaxSize = 5000;

/**
* NullValue 的清理频率(秒)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* 该Task的主要目的是尽可能的保证 L1Cache 中是最新的数据。如guava、caffeine在访问时,若数据过期则先返回旧数据,再执行数据加载。
* 如果 L1Cache 是 LoadingCache,并且自定义CuntomCacheLoader中 L2Cache 不为空,则同时刷新L1Cache和L2Cache。
*
* 注:该功能不建议使用,后续会废弃掉
*
* @author chenck
* @date 2020/7/6 9:58
*/
Expand Down

0 comments on commit 500c738

Please sign in to comment.