[bugfix] Fixed #3112, disappear left menu tree item when restart service (#3116)

Co-authored-by: tomsun28 <tomsun28@outlook.com>
Co-authored-by: yunfan24 <yunfan24@outlook.com>
Co-authored-by: aias00 <rokkki@163.com>
This commit is contained in:
不关银渐层的事哦
2025-03-15 20:47:53 +08:00
committed by GitHub
co-authored by tomsun28 yunfan24 aias00
parent dc2efdf1c2
commit d2a332f533
3 changed files with 5 additions and 5 deletions
@@ -72,7 +72,7 @@ public abstract class AbstractCollectE2eTest {
metricsCollect = new MetricsCollect(mock(Metrics.class), timeout, mock(CollectDataDispatch.class), null, List.of());
// Initialize services and components
appService.run();
appService.afterPropertiesSet();
metrics = new Metrics();
}
@@ -63,7 +63,7 @@ import org.apache.hertzbeat.manager.service.AppService;
import org.apache.hertzbeat.manager.service.MonitorService;
import org.apache.hertzbeat.manager.service.ObjectStoreService;
import org.apache.hertzbeat.warehouse.service.WarehouseService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.event.EventListener;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
@@ -80,7 +80,7 @@ import org.yaml.snakeyaml.Yaml;
@Service
@Order(value = Ordered.HIGHEST_PRECEDENCE)
@Slf4j
public class AppServiceImpl implements AppService, CommandLineRunner {
public class AppServiceImpl implements AppService, InitializingBean {
private static final String PUSH_PROTOCOL_METRICS_NAME = "metrics";
@@ -500,7 +500,7 @@ public class AppServiceImpl implements AppService, CommandLineRunner {
}
@Override
public void run(String... args) throws Exception {
public void afterPropertiesSet() throws Exception {
var objectStoreConfig = objectStoreConfigService.getConfig();
refreshStore(objectStoreConfig);
}
@@ -55,7 +55,7 @@ class AppServiceTest {
@BeforeEach
void setUp() throws Exception {
appService.run();
appService.afterPropertiesSet();
}
@Test