refactor
This commit is contained in:
parent
ebb9f59196
commit
ce2bf344f9
@ -68,6 +68,7 @@ void eviction::service_function() {
|
|||||||
REPERTORY_USES_FUNCTION_NAME();
|
REPERTORY_USES_FUNCTION_NAME();
|
||||||
|
|
||||||
auto cached_files_list = get_filtered_cached_files();
|
auto cached_files_list = get_filtered_cached_files();
|
||||||
|
auto was_file_evicted{false};
|
||||||
while (not get_stop_requested() && not cached_files_list.empty()) {
|
while (not get_stop_requested() && not cached_files_list.empty()) {
|
||||||
auto file_path = cached_files_list.front();
|
auto file_path = cached_files_list.front();
|
||||||
cached_files_list.pop_front();
|
cached_files_list.pop_front();
|
||||||
@ -79,7 +80,9 @@ void eviction::service_function() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
file_mgr_.evict_file(api_path);
|
if (file_mgr_.evict_file(api_path)) {
|
||||||
|
was_file_evicted = true;
|
||||||
|
}
|
||||||
} catch (const std::exception &ex) {
|
} catch (const std::exception &ex) {
|
||||||
utils::error::raise_error(
|
utils::error::raise_error(
|
||||||
function_name, ex,
|
function_name, ex,
|
||||||
@ -87,7 +90,7 @@ void eviction::service_function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get_stop_requested()) {
|
if (get_stop_requested() || was_file_evicted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user