Browse Source

Disregard exceptions in the bootstrap creation cleanup process because these don't affect the created bootstrap - instead just log the exception and full stack trace.

v2.0-beta
CalDescent 3 years ago
parent
commit
f6c1a7e6db
  1. 12
      src/main/java/org/qortal/repository/Bootstrap.java

12
src/main/java/org/qortal/repository/Bootstrap.java

@ -278,14 +278,22 @@ public class Bootstrap {
throw new DataException(String.format("Unable to create bootstrap due to timeout: %s", e.getMessage()));
}
finally {
try {
LOGGER.info("Re-importing local data...");
Path exportPath = HSQLDBImportExport.getExportDirectory(false);
repository.importDataFromFile(Paths.get(exportPath.toString(), "TradeBotStates.json").toString());
repository.importDataFromFile(Paths.get(exportPath.toString(), "MintingAccounts.json").toString());
} catch (IOException e) {
LOGGER.info("Unable to re-import local data, but created bootstrap is still valid. {}", e);
}
LOGGER.info("Unlocking blockchain...");
blockchainLock.unlock();
// Cleanup
LOGGER.info("Cleaning up...");
try {
if (inputPath != null) {
FileUtils.deleteDirectory(inputPath.toFile());
}
@ -293,6 +301,10 @@ public class Bootstrap {
FileUtils.deleteDirectory(outputPath.toFile());
}
this.deleteAllTempDirectories();
} catch (IOException e) {
LOGGER.info("Error during cleanup, but created bootstrap is still valid. {}", e);
}
}
}

Loading…
Cancel
Save