From 7c16be15b1f9158da1a4e00aeda8db60edb27c6f Mon Sep 17 00:00:00 2001 From: Danilo Spinella Date: Mon, 18 Nov 2024 12:37:33 +0100 Subject: [PATCH] fix(image_loader): Add requester to the list When an image was being loaded in the background and a new requester came in, it was not added to the list, causing the image to be loaded each time from scratch. --- daemon/src/image_loader.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/src/image_loader.rs b/daemon/src/image_loader.rs index ae77c03..d56a6da 100644 --- a/daemon/src/image_loader.rs +++ b/daemon/src/image_loader.rs @@ -53,6 +53,10 @@ impl ImageLoader { // the thread is still running // reassign the handle image.thread_handle = Some(handle); + // if this is a new requester, add it to the list + if !image.requesters.contains(&requester_name) { + image.requesters.push(requester_name); + } return ImageLoaderStatus::Waiting; } }