mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-06 12:24:33 -05:00
Use temporary file for H2 migration tools download (#2169)
This commit is contained in:
@@ -130,9 +130,12 @@ object H2Migration {
|
||||
)
|
||||
}
|
||||
|
||||
output.outputStream().use { out ->
|
||||
val tmp = output.resolveSibling(output.name + ".tmp")
|
||||
tmp.outputStream().use { out ->
|
||||
response.body.byteStream().copyTo(out)
|
||||
}
|
||||
tmp.copyTo(output)
|
||||
tmp.deleteExisting()
|
||||
}
|
||||
|
||||
logger.info { "Saved: ${output.absolutePathString()}" }
|
||||
|
||||
Reference in New Issue
Block a user