Using cache reference for query UI menu#11099
Conversation
Sonatype Lift is retiringSonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. |
| this.menuItemFuture = new CompletableFuture<>(); | ||
| this.menuItemCache = CacheBuilder.newBuilder() | ||
| .maximumSize(1) | ||
| .refreshAfterWrite(moduleConfig.getUiMenuRefreshInterval(), TimeUnit.SECONDS) |
There was a problem hiding this comment.
RefreshAfterWrite? Where would we write this cache?
Do I misread the codes?
There was a problem hiding this comment.
The cache would be read from the database and written into the cache when accessing the menu for the first time. After the writing is completed, a timer starts counting, and when it reaches a certain point, the data would be automatically rewritten.
There was a problem hiding this comment.
Why push first time late? This kind of mechanism usually is used for cold data, but menu is super hot. I think the timer should be up and running after initialized(if needed).
There was a problem hiding this comment.
updated, please re-check
wu-sheng
left a comment
There was a problem hiding this comment.
@kezhenxu94 Another round check?
CHANGESlog.