forked from Qortal/qortal
Break out of the AT pruning inner loops if we're stopping the app.
This commit is contained in:
parent
22efaccd4a
commit
f5910ab950
@ -727,6 +727,11 @@ public class HSQLDBATRepository implements ATRepository {
|
|||||||
|
|
||||||
for (int height=minHeight; height<maxHeight; height++) {
|
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
|
// Get latest AT states for this height
|
||||||
List<String> atAddresses = new ArrayList<>();
|
List<String> atAddresses = new ArrayList<>();
|
||||||
String updateSql = "SELECT AT_address FROM LatestATStates WHERE height = ?";
|
String updateSql = "SELECT AT_address FROM LatestATStates WHERE height = ?";
|
||||||
@ -746,6 +751,11 @@ public class HSQLDBATRepository implements ATRepository {
|
|||||||
for (ATStateData atState : atStates) {
|
for (ATStateData atState : atStates) {
|
||||||
//LOGGER.info("Found atState {} at height {}", atState.getATAddress(), atState.getHeight());
|
//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())) {
|
if (atAddresses.contains(atState.getATAddress())) {
|
||||||
// We don't want to delete this AT state because it is still active
|
// We don't want to delete this AT state because it is still active
|
||||||
LOGGER.info("Skipping atState {} at height {}", atState.getATAddress(), atState.getHeight());
|
LOGGER.info("Skipping atState {} at height {}", atState.getATAddress(), atState.getHeight());
|
||||||
|
Loading…
Reference in New Issue
Block a user