Skip to content

Commit

Permalink
DMP-4065 UnstructuredToArmDataStore leaves record stuck in 'Arm Inges…
Browse files Browse the repository at this point in the history
…tion'

Added shutdown hook
  • Loading branch information
karen-hedges committed Feb 7, 2025
1 parent 7ccdbb5 commit 10adb64
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,18 +229,19 @@ public void destroy() throws Exception {
}

private void resetEodStatusOnShutdown() {
log.info("UnstructuredToArmBatchProcessorImpl shutting down.");
System.out.println("UnstructuredToArmBatchProcessorImpl shutting down.");
if (CollectionUtils.isNotEmpty(eodsForTransfer)) {

//create a new list based on the eodsForTransfer minus eodsAlreadyTransferred
List<Integer> missingEods = eodsForTransfer.stream().filter(eod -> !eodsAlreadyTransferred.contains(eod)).collect(Collectors.toList());
log.info("Reverting EODs to failed status for potentially EODs {}", missingEods.size());
System.out.println("Reverting EODs to failed status for potentially EODs " + missingEods.size());
String missingEodIds = missingEods.stream().map(String::valueOf).collect(Collectors.joining(","));
log.info("EODs {} will need be reverted to arm raw data failed", missingEodIds);
System.out.println("EODs will need be reverted to arm raw data failed " + missingEodIds);

missingEods.forEach(eodId -> log.info("EOD ID: {} has been reverted to arm raw data failed status", eodId));
missingEods.forEach(eodId -> System.out.println("EOD ID: {} has been reverted to arm raw data failed status " + eodId));
} else {
log.info("No EODs to revert to failed status");
System.out.println("No EODs to revert to failed status");
}
log.info("UnstructuredToArmBatchProcessorImpl has shut down.");
System.out.println("UnstructuredToArmBatchProcessorImpl has shut down.");
}
}

0 comments on commit 10adb64

Please sign in to comment.