diff --git a/src/main/java/org/gridsuite/sensitivityanalysis/server/repositories/SensitivityAnalysisResultRepository.java b/src/main/java/org/gridsuite/sensitivityanalysis/server/repositories/SensitivityAnalysisResultRepository.java index b477cf3e..00c917e2 100644 --- a/src/main/java/org/gridsuite/sensitivityanalysis/server/repositories/SensitivityAnalysisResultRepository.java +++ b/src/main/java/org/gridsuite/sensitivityanalysis/server/repositories/SensitivityAnalysisResultRepository.java @@ -112,11 +112,11 @@ public void insertStatus(List resultUuids, String status) { } @Transactional - public void insert(UUID resultUuid, SensitivityAnalysisResult result) { + public void insert(UUID resultUuid, SensitivityAnalysisResult result, String status) { Objects.requireNonNull(resultUuid); - if (result != null) { analysisResultRepository.save(toAnalysisResultEntity(resultUuid, result)); + globalStatusRepository.save(toStatusEntity(resultUuid, status)); } } diff --git a/src/main/java/org/gridsuite/sensitivityanalysis/server/service/SensitivityAnalysisWorkerService.java b/src/main/java/org/gridsuite/sensitivityanalysis/server/service/SensitivityAnalysisWorkerService.java index 34d5e53c..3f3fa982 100644 --- a/src/main/java/org/gridsuite/sensitivityanalysis/server/service/SensitivityAnalysisWorkerService.java +++ b/src/main/java/org/gridsuite/sensitivityanalysis/server/service/SensitivityAnalysisWorkerService.java @@ -239,8 +239,7 @@ public Consumer> consumeRun() { long nanoTime = System.nanoTime(); LOGGER.info("Just run in {}s", TimeUnit.NANOSECONDS.toSeconds(nanoTime - startTime.getAndSet(nanoTime))); - resultRepository.insert(resultContext.getResultUuid(), result); - resultRepository.insertStatus(List.of(resultContext.getResultUuid()), SensitivityAnalysisStatus.COMPLETED.name()); + resultRepository.insert(resultContext.getResultUuid(), result, SensitivityAnalysisStatus.COMPLETED.name()); long finalNanoTime = System.nanoTime(); LOGGER.info("Stored in {}s", TimeUnit.NANOSECONDS.toSeconds(finalNanoTime - startTime.getAndSet(finalNanoTime)));