Skip to content

Commit

Permalink
Merge pull request #1784 from alliance-genome/SCRUM-2726
Browse files Browse the repository at this point in the history
Use runtime exception
  • Loading branch information
oblodgett authored Jan 7, 2025
2 parents 65ccb38 + a304f75 commit 8e8f721
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ protected <E extends AuditedObject, T extends BaseDTO> boolean runLoad(BaseUpser

protected <E extends AuditedObject, T extends BaseDTO> boolean runLoad(BaseUpsertServiceInterface<E, T> service, BulkLoadFileHistory history, BackendBulkDataProvider dataProvider, List<T> objectList, List<Long> 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);
Expand Down Expand Up @@ -259,9 +259,7 @@ protected <E extends AuditedObject, T extends BaseDTO> 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);
Expand All @@ -278,7 +276,7 @@ protected <E extends AuditedObject, T extends BaseDTO> boolean runLoad(BaseUpser
// The following methods are for bulk validation
protected <S extends BaseEntityCrudService<?, ?>> void runCleanup(S service, BulkLoadFileHistory history, String dataProviderName, List<Long> annotationIdsBefore, List<Long> annotationIdsAfter, String loadTypeString, Boolean deprecate) {
if (Thread.currentThread().isInterrupted()) {
return;
throw new RuntimeException("Thread isInterrupted");
}
Log.debug("runLoad: After: " + dataProviderName + " " + annotationIdsAfter.size());

Expand Down Expand Up @@ -314,9 +312,7 @@ protected <E extends AuditedObject, T extends BaseDTO> 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);
Expand Down

0 comments on commit 8e8f721

Please sign in to comment.