From 0ba06f798cff8ea97638f9a4efd2a510eb4f5ed8 Mon Sep 17 00:00:00 2001 From: Olin Blodgett Date: Mon, 6 Jan 2025 22:19:45 -0500 Subject: [PATCH] Use runtime exception --- .../jobs/executors/LoadFileExecutor.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 712e7fd78..ee4dc8183 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 @@ -219,7 +219,7 @@ protected boolean runLoad(BaseUpser protected boolean runLoad(BaseUpsertServiceInterface service, BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List objectList, List idsAdded, Boolean terminateFailing, String countType, String dataType) { if (Thread.currentThread().isInterrupted()) { - return false; + throw new RuntimeException("Thread isInterrupted"); } ProcessDisplayHelper ph = new ProcessDisplayHelper(); ph.addDisplayHandler(loadProcessDisplayService); @@ -259,9 +259,7 @@ protected boolean runLoad(BaseUpser } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - history.setBulkloadStatus(JobStatus.FORCED_STOPPED); - Log.info("Thread Interrupted:"); - break; + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history); @@ -278,7 +276,7 @@ protected boolean runLoad(BaseUpser // The following methods are for bulk validation protected > void runCleanup(S service, BulkLoadFileHistory history, String dataProviderName, List annotationIdsBefore, List annotationIdsAfter, String loadTypeString, Boolean deprecate) { if (Thread.currentThread().isInterrupted()) { - return; + throw new RuntimeException("Thread isInterrupted"); } Log.debug("runLoad: After: " + dataProviderName + " " + annotationIdsAfter.size()); @@ -314,9 +312,7 @@ protected boolean runLoad(BaseUpser } ph.progressProcess(); if (Thread.currentThread().isInterrupted()) { - history.setBulkloadStatus(JobStatus.FORCED_STOPPED); - Log.info("Thread Interrupted:"); - break; + throw new RuntimeException("Thread isInterrupted"); } } updateHistory(history);