Skip to content

Commit d2a332f

Browse files
notbuggggtomsun28yunfan24Aias00
authored
[bugfix] Fixed apache#3112, disappear left menu tree item when restart service (apache#3116)
Co-authored-by: tomsun28 <[email protected]> Co-authored-by: yunfan24 <[email protected]> Co-authored-by: aias00 <[email protected]>
1 parent dc2efdf commit d2a332f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

hertzbeat-e2e/hertzbeat-collector-common-e2e/src/test/java/org/apache/hertzbeat/collector/collect/AbstractCollectE2eTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public void setUp() throws Exception {
7272
metricsCollect = new MetricsCollect(mock(Metrics.class), timeout, mock(CollectDataDispatch.class), null, List.of());
7373

7474
// Initialize services and components
75-
appService.run();
75+
appService.afterPropertiesSet();
7676
metrics = new Metrics();
7777
}
7878

hertzbeat-manager/src/main/java/org/apache/hertzbeat/manager/service/impl/AppServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
import org.apache.hertzbeat.manager.service.MonitorService;
6464
import org.apache.hertzbeat.manager.service.ObjectStoreService;
6565
import org.apache.hertzbeat.warehouse.service.WarehouseService;
66-
import org.springframework.boot.CommandLineRunner;
66+
import org.springframework.beans.factory.InitializingBean;
6767
import org.springframework.context.event.EventListener;
6868
import org.springframework.core.Ordered;
6969
import org.springframework.core.annotation.Order;
@@ -80,7 +80,7 @@
8080
@Service
8181
@Order(value = Ordered.HIGHEST_PRECEDENCE)
8282
@Slf4j
83-
public class AppServiceImpl implements AppService, CommandLineRunner {
83+
public class AppServiceImpl implements AppService, InitializingBean {
8484

8585
private static final String PUSH_PROTOCOL_METRICS_NAME = "metrics";
8686

@@ -500,7 +500,7 @@ public void updateCustomTemplateConfig(TemplateConfig config) {
500500
}
501501

502502
@Override
503-
public void run(String... args) throws Exception {
503+
public void afterPropertiesSet() throws Exception {
504504
var objectStoreConfig = objectStoreConfigService.getConfig();
505505
refreshStore(objectStoreConfig);
506506
}

hertzbeat-manager/src/test/java/org/apache/hertzbeat/manager/service/AppServiceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class AppServiceTest {
5555

5656
@BeforeEach
5757
void setUp() throws Exception {
58-
appService.run();
58+
appService.afterPropertiesSet();
5959
}
6060

6161
@Test

0 commit comments

Comments
 (0)