fix:修改同步CAC的方法

main
郭承 7 months ago
parent 95dfe7bbe4
commit e9faf0e10e

@ -61,19 +61,24 @@ public class XydlServiceImpl implements XydlService {
if (CollectionUtils.isEmpty(cacDataNodeList)) { if (CollectionUtils.isEmpty(cacDataNodeList)) {
return CacUtil.buildResult(); return CacUtil.buildResult();
} }
CompletableFuture<Void> completableFuture = CompletableFuture.allOf(cacDataNodeList for (CacDataNode cacDataNode : cacDataNodeList) {
cacParseFactory.parse(request , cacDataNode);
}
/* CompletableFuture<Void> completableFuture = CompletableFuture.allOf(cacDataNodeList
.stream().map(cacDataNode -> CompletableFuture .stream().map(cacDataNode -> CompletableFuture
.supplyAsync(() -> cacParseFactory.parse(request, cacDataNode), taskExecutor)) .supplyAsync(() -> cacParseFactory.parse(request, cacDataNode), taskExecutor))
.toArray(CompletableFuture[]::new)); .toArray(CompletableFuture[]::new));
completableFuture.get(); completableFuture.get(); */
return CacUtil.buildResult(); return CacUtil.buildResult();
} catch (ConversionException e) { } catch (ConversionException e) {
logger.error(e.getMessage()); logger.error(e.getMessage());
return CacUtil.buildResult(); return CacUtil.buildResult();
} catch (InterruptedException | ExecutionException e) { }
/* catch (InterruptedException | ExecutionException e) {
logger.error("parse error", e); logger.error("parse error", e);
return CacUtil.buildResult(); return CacUtil.buildResult();
} catch (Exception e) { } */
catch (Exception e) {
logger.error("parse error", e); logger.error("parse error", e);
return CacUtil.buildResult(); return CacUtil.buildResult();
} }

Loading…
Cancel
Save