kezhenxu94 commented on code in PR #11099:
URL: https://github.com/apache/skywalking/pull/11099#discussion_r1264704203
##########
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/menu/UIMenuManagementService.java:
##########
@@ -83,46 +92,23 @@ public void saveMenuAndStartFetch(List<UIMenuItemSetting>
menuItems, int fetchIn
menu.setConfigurationJson(GSON.toJson(menuItems));
getMenuDAO().saveMenu(menu);
- startingFetchMenu(fetchInterval);
- }
-
- private void startingFetchMenu(int fetchIntervalSecond) {
- Executors.newSingleThreadScheduledExecutor()
- .scheduleWithFixedDelay(this, 0, fetchIntervalSecond,
java.util.concurrent.TimeUnit.SECONDS);
+ this.menuItemCache.put(true, fetchMenuItems());
Review Comment:
There is no point to call cache `fetchMenuItems`, just call cache.get(true)
and the loading cache finds it absent and will call the fetchMenuItems inside
the load method
```suggestion
this.menuItemCache.get(true);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]