perf(image): remove redundant Vec clone before spawn_blocking
This commit is contained in:
parent
c0b14ed498
commit
a71da7473d
@ -489,12 +489,11 @@ pub async fn serve_image(
|
|||||||
|
|
||||||
// Offload decode + resize + encode to the blocking pool so the async
|
// Offload decode + resize + encode to the blocking pool so the async
|
||||||
// runtime stays responsive to other requests.
|
// runtime stays responsive to other requests.
|
||||||
let data_for_blocking = data.clone();
|
|
||||||
let path_for_blocking = path.clone();
|
let path_for_blocking = path.clone();
|
||||||
let params_for_blocking = params.clone();
|
let params_for_blocking = params.clone();
|
||||||
let (processed, content_type) =
|
let (processed, content_type) =
|
||||||
match tokio::task::spawn_blocking(move || {
|
match tokio::task::spawn_blocking(move || {
|
||||||
process_image_blocking(data_for_blocking, params_for_blocking, path_for_blocking)
|
process_image_blocking(data, params_for_blocking, path_for_blocking)
|
||||||
})
|
})
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user