此代码使用 99-100% CPU:
drop.post("upload") { request in
guard let file = request.multipart?["zip"]?.file, let name = file.name else {
throw Abort.badRequest
}
try Data(bytes: file.data).write(to: URL(fileURLWithPath: "/tmp/\(name)"))
return "OK"
}
如何优化这个任务?