Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature:Support_LRU_User_Info_Cache #156

Merged

Conversation

cmgyqjj
Copy link
Contributor

@cmgyqjj cmgyqjj commented Sep 21, 2024

There is a TODO item in the list: The User_Info_Map is implemented using ConcurrentHashMap. Although it will automatically expand, excessive expansion can lead to memory overflow. To prevent unlimited expansion, use LoadingCache to load the cache instead.

@crossoverJie crossoverJie added the enhancement New feature or request label Sep 22, 2024
@crossoverJie crossoverJie added this to the 
v2.0.0 milestone Sep 22, 2024
@Autowired
private RedisTemplate<String,String> redisTemplate ;

@Autowired
private LoadingCache<Long, CIMUserInfo> USER_INFO_MAP;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use camel case naming for variable name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, USER_INFO_MAP has been replaced by userInfoMap.

Copy link

codecov bot commented Sep 22, 2024

Codecov Report

Attention: Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.

Project coverage is 37.34%. Comparing base (1a11353) to head (dbde9e8).
Report is 24 commits behind head on master.

Files with missing lines Patch % Lines
.../com/crossoverjie/cim/route/config/BeanConfig.java 72.72% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #156      +/-   ##
============================================
+ Coverage     37.14%   37.34%   +0.20%     
  Complexity      301      301              
============================================
  Files            75       75              
  Lines          2221     2225       +4     
  Branches        252      251       -1     
============================================
+ Hits            825      831       +6     
+ Misses         1357     1356       -1     
+ Partials         39       38       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@crossoverJie crossoverJie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution.

@crossoverJie crossoverJie merged commit 29dcbea into crossoverJie:master Sep 22, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants