Browse Source

Break out of the AT pruning inner loops if we're stopping the app.

pruning-mode
CalDescent 3 years ago
parent
commit
f5910ab950
  1. 10
      src/main/java/org/qortal/repository/hsqldb/HSQLDBATRepository.java

10
src/main/java/org/qortal/repository/hsqldb/HSQLDBATRepository.java

@ -727,6 +727,11 @@ public class HSQLDBATRepository implements ATRepository {
for (int height=minHeight; height<maxHeight; height++) {
// Give up if we're stopping
if (Controller.isStopping()) {
return deletedCount;
}
// Get latest AT states for this height
List<String> atAddresses = new ArrayList<>();
String updateSql = "SELECT AT_address FROM LatestATStates WHERE height = ?";
@ -746,6 +751,11 @@ public class HSQLDBATRepository implements ATRepository {
for (ATStateData atState : atStates) {
//LOGGER.info("Found atState {} at height {}", atState.getATAddress(), atState.getHeight());
// Give up if we're stopping
if (Controller.isStopping()) {
return deletedCount;
}
if (atAddresses.contains(atState.getATAddress())) {
// We don't want to delete this AT state because it is still active
LOGGER.info("Skipping atState {} at height {}", atState.getATAddress(), atState.getHeight());

Loading…
Cancel
Save