diff --git a/repertory/librepertory/src/drives/eviction.cpp b/repertory/librepertory/src/drives/eviction.cpp index 4d62f687..b22ccff0 100644 --- a/repertory/librepertory/src/drives/eviction.cpp +++ b/repertory/librepertory/src/drives/eviction.cpp @@ -68,6 +68,7 @@ void eviction::service_function() { REPERTORY_USES_FUNCTION_NAME(); auto cached_files_list = get_filtered_cached_files(); + auto was_file_evicted{false}; while (not get_stop_requested() && not cached_files_list.empty()) { auto file_path = cached_files_list.front(); cached_files_list.pop_front(); @@ -79,7 +80,9 @@ void eviction::service_function() { continue; } - file_mgr_.evict_file(api_path); + if (file_mgr_.evict_file(api_path)) { + was_file_evicted = true; + } } catch (const std::exception &ex) { utils::error::raise_error( function_name, ex, @@ -87,7 +90,7 @@ void eviction::service_function() { } } - if (get_stop_requested()) { + if (get_stop_requested() || was_file_evicted) { return; }