From 87da611749c30e390013d5a71d73b0a56bbf5f39 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Tue, 25 Jun 2024 09:56:52 +0100 Subject: [PATCH] Turn off failure limit for paralogy and interaction loads --- .../jobs/executors/GeneGeneticInteractionExecutor.java | 2 +- .../executors/GeneMolecularInteractionExecutor.java | 2 +- .../curation_api/jobs/executors/LoadFileExecutor.java | 10 +++++++--- .../curation_api/jobs/executors/ParalogyExecutor.java | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneGeneticInteractionExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneGeneticInteractionExecutor.java index c34ebeb35..cba477bd8 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneGeneticInteractionExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneGeneticInteractionExecutor.java @@ -42,7 +42,7 @@ public void execLoad(BulkLoadFile bulkLoadFile) { BulkLoadFileHistory history = new BulkLoadFileHistory(interactionData.size()); createHistory(history, bulkLoadFile); - boolean success = runLoad(geneGeneticInteractionService, history, null, interactionData, interactionIdsLoaded); + boolean success = runLoad(geneGeneticInteractionService, history, null, interactionData, interactionIdsLoaded, false); if (success) { runCleanup(geneInteractionService, history, "COMBINED", interactionIdsBefore, interactionIdsLoaded, "gene genetic interaction", bulkLoadFile.getMd5Sum()); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneMolecularInteractionExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneMolecularInteractionExecutor.java index d9797391a..acfbe9953 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneMolecularInteractionExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/GeneMolecularInteractionExecutor.java @@ -41,7 +41,7 @@ public void execLoad(BulkLoadFile bulkLoadFile) { BulkLoadFileHistory history = new BulkLoadFileHistory(interactionData.size()); createHistory(history, bulkLoadFile); - boolean success = runLoad(geneMolecularInteractionService, history, null, interactionData, interactionIdsLoaded); + boolean success = runLoad(geneMolecularInteractionService, history, null, interactionData, interactionIdsLoaded, false); if (success) { runCleanup(geneInteractionService, history, "COMBINED", interactionIdsBefore, interactionIdsLoaded, "gene molecular interaction", bulkLoadFile.getMd5Sum()); } diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java index 370c0343d..78d98501f 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/LoadFileExecutor.java @@ -196,12 +196,16 @@ public APIResponse runLoadApi(BaseU if (dataProviderName != null) { dataProvider = BackendBulkDataProvider.valueOf(dataProviderName); } - runLoad(service, history, dataProvider, objectList, idsLoaded); + runLoad(service, history, dataProvider, objectList, idsLoaded, true); history.finishLoad(); return new LoadHistoryResponce(history); } - + protected boolean runLoad(BaseUpsertServiceInterface service, BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List objectList, List idsAdded) { + return runLoad(service, history, dataProvider, objectList, idsAdded, true); + } + + protected boolean runLoad(BaseUpsertServiceInterface service, BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List objectList, List idsAdded, Boolean terminateFailing) { ProcessDisplayHelper ph = new ProcessDisplayHelper(); ph.addDisplayHandler(loadProcessDisplayService); if (CollectionUtils.isNotEmpty(objectList)) { @@ -227,7 +231,7 @@ protected boolean runLoad(BaseUpser history.incrementFailed(); addException(history, new ObjectUpdateExceptionData(dtoObject, e.getMessage(), e.getStackTrace())); } - if (history.getErrorRate() > 0.25) { + if (terminateFailing && history.getErrorRate() > 0.25) { Log.error("Failure Rate > 25% aborting load"); finalSaveHistory(history); return false; diff --git a/src/main/java/org/alliancegenome/curation_api/jobs/executors/ParalogyExecutor.java b/src/main/java/org/alliancegenome/curation_api/jobs/executors/ParalogyExecutor.java index 3252401c9..f2cbf69c6 100644 --- a/src/main/java/org/alliancegenome/curation_api/jobs/executors/ParalogyExecutor.java +++ b/src/main/java/org/alliancegenome/curation_api/jobs/executors/ParalogyExecutor.java @@ -48,7 +48,7 @@ public void execLoad(BulkLoadFile bulkLoadFile) { BulkLoadFileHistory history = new BulkLoadFileHistory(paralogyData.getData().size()); createHistory(history, bulkLoadFile); - boolean success = runLoad(geneToGeneParalogyService, history, dataProvider, paralogyData.getData(), paralogyIdsLoaded); + boolean success = runLoad(geneToGeneParalogyService, history, dataProvider, paralogyData.getData(), paralogyIdsLoaded, false); if (success) { runCleanup(geneToGeneParalogyService, history, fms.getFmsDataSubType(), paralogyPairsBefore, paralogyIdsLoaded, fms.getFmsDataType(), bulkLoadFile.getMd5Sum(), false);