use of com.epam.reportportal.extension.event.LaunchAutoAnalysisFinishEvent in project service-api by reportportal.
the class LaunchAutoAnalysisSubscriber method handleEvent.
@Override
public void handleEvent(LaunchFinishedEvent launchFinishedEvent, Project project, Launch launch) {
AnalyzerConfig analyzerConfig = AnalyzerUtils.getAnalyzerConfig(project);
if (BooleanUtils.isTrue(analyzerConfig.getIsAutoAnalyzerEnabled())) {
List<Long> itemIds = analyzeCollectorFactory.getCollector(AnalyzeItemsMode.TO_INVESTIGATE).collectItems(project.getId(), launch.getId(), launchFinishedEvent.getUser());
logIndexer.indexLaunchLogs(project.getId(), launch.getId(), analyzerConfig).join();
analyzerServiceAsync.analyze(launch, itemIds, analyzerConfig).thenRunAsync(() -> eventPublisher.publishEvent(new LaunchAutoAnalysisFinishEvent(launch.getId()))).join();
// TODO provide executor
CompletableFuture.supplyAsync(() -> logIndexer.indexItemsLogs(project.getId(), launch.getId(), itemIds, analyzerConfig));
} else {
logIndexer.indexLaunchLogs(project.getId(), launch.getId(), analyzerConfig);
eventPublisher.publishEvent(new LaunchAutoAnalysisFinishEvent(launch.getId()));
}
}
Aggregations