Fixed race condition when deleting temporary files

This commit is contained in:
Daniel Wolf 2018-02-18 20:51:50 +01:00
parent 64bdf78b85
commit 33dbf6c579
1 changed files with 4 additions and 1 deletions

View File

@ -44,7 +44,8 @@ class RhubarbTask(
val message = parseJsonObject(line)
when (message.string("type")!!) {
"progress" -> {
reportProgress(message.double("value")!!)}
reportProgress(message.double("value")!!)
}
"success" -> {
reportProgress(1.0)
val resultString = String(Files.readAllBytes(outputFile.filePath), StandardCharsets.UTF_8)
@ -60,6 +61,8 @@ class RhubarbTask(
throw e
} catch (e: EOFException) {
throw Exception("Rhubarb terminated unexpectedly.")
} finally {
process.waitFor();
}
}}