Fixed race condition when deleting temporary files
This commit is contained in:
parent
64bdf78b85
commit
33dbf6c579
|
@ -44,7 +44,8 @@ class RhubarbTask(
|
||||||
val message = parseJsonObject(line)
|
val message = parseJsonObject(line)
|
||||||
when (message.string("type")!!) {
|
when (message.string("type")!!) {
|
||||||
"progress" -> {
|
"progress" -> {
|
||||||
reportProgress(message.double("value")!!)}
|
reportProgress(message.double("value")!!)
|
||||||
|
}
|
||||||
"success" -> {
|
"success" -> {
|
||||||
reportProgress(1.0)
|
reportProgress(1.0)
|
||||||
val resultString = String(Files.readAllBytes(outputFile.filePath), StandardCharsets.UTF_8)
|
val resultString = String(Files.readAllBytes(outputFile.filePath), StandardCharsets.UTF_8)
|
||||||
|
@ -60,6 +61,8 @@ class RhubarbTask(
|
||||||
throw e
|
throw e
|
||||||
} catch (e: EOFException) {
|
} catch (e: EOFException) {
|
||||||
throw Exception("Rhubarb terminated unexpectedly.")
|
throw Exception("Rhubarb terminated unexpectedly.")
|
||||||
|
} finally {
|
||||||
|
process.waitFor();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue