You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "He-Pin (via GitHub)" <gi...@apache.org> on 2023/06/04 09:13:45 UTC
[GitHub] [incubator-pekko-http] He-Pin commented on a diff in pull request #170: Use java NIO to create temp file
He-Pin commented on code in PR #170:
URL: https://github.com/apache/incubator-pekko-http/pull/170#discussion_r1216439433
##########
http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/FileUploadDirectives.scala:
##########
@@ -175,9 +176,12 @@ trait FileUploadDirectives {
implicit val ec = ctx.executionContext
def tempDest(fileInfo: FileInfo): File = {
- val dest = File.createTempFile("pekko-http-upload", ".tmp")
- dest.deleteOnExit()
- dest
+ val dest = Files.createTempFile("pekko-http-upload", ".tmp")
+ Runtime.getRuntime.addShutdownHook(new Thread() {
Review Comment:
Will there have many hook threads?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org