You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "kezhenxu94 (via GitHub)" <gi...@apache.org> on 2023/07/16 15:43:09 UTC
[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #11099: Using cache reference for query UI menu
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org