Fixing Async issue where single team/project project mode exits too quickly.
@@ -229,8 +229,14 @@ public class MachinaService {
}
else {
getCxFields(project, request);
- return resutlsService.processScanResultsAsync(request, scanId, request.getFilters());
+ CompletableFuture<ScanResults> results = resutlsService.processScanResultsAsync(request, scanId, request.getFilters());
+ /*If cxProject is null, it is a single project request*/
+ if(cxProject == null) {
+ results.join();
+ }
+ return results;
}
+
} catch (MachinaException e) {
log.debug(ExceptionUtils.getStackTrace(e));
log.error("Error occurred while processing results for {}{}", request.getTeam(), request.getProject());
