ENT-3496 Create log directory to place dumps if it does not already exist

This commit is contained in:
LankyDan 2019-06-10 15:10:34 +01:00
parent 684e9cdf58
commit d8395baf62

View File

@ -89,6 +89,7 @@ class CheckpointDumper(private val checkpointStorage: CheckpointStorage, private
try {
val file = serviceHub.configuration.baseDirectory / "logs" / "checkpoints_dump-${TIME_FORMATTER.format(serviceHub.clock.instant())}.zip"
if (lock.getAndIncrement() == 0 && !file.exists()) {
file.parent.toFile().mkdirs()
database.transaction {
checkpointStorage.getAllCheckpoints().use { stream ->
ZipOutputStream(file.outputStream()).use { zip ->