feat: 优化rpc构建 step2

This commit is contained in:
zengxiaobo 2024-07-11 17:29:49 +08:00
parent 944fcaf70a
commit 35bfdff8e4

View File

@ -38,12 +38,11 @@ public class AppCenterImpl implements AppCenter {
@Builder
public AppCenterImpl(ScheduledThreadPoolExecutor executor,
String debugHost,
Map<String, String> debugAppRoutes,
RpcClient rpcClient) {
Map<String, String> debugAppRoutes) {
Objects.requireNonNull(executor);
this.rpcClient = Optional.ofNullable(rpcClient).orElseGet(() -> RpcClientImpl.builder().build());
this.rpcClient = RpcClientImpl.builder().build();
this.appCache = new TimerRefreshCache<>("appCenterCache", INITIAL_DELAY_MILLIS,
REFRESH_INTERVAL_MILLIS, executor, this::loadApps);
this.debugHost = debugHost;