continue fixes for dead-lock when max cache size is reached
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2024-12-24 11:30:43 -06:00
parent 7ec7544995
commit 66df44a8dd

View File

@ -56,7 +56,9 @@ auto cache_size_mgr::expand(std::uint64_t size, bool should_wait) -> api_error {
auto max_cache_size = cfg_->get_max_cache_size_bytes(); auto max_cache_size = cfg_->get_max_cache_size_bytes();
while (not stop_requested_ && cache_size_ > max_cache_size) { auto cache_dir = utils::file::directory{cfg_->get_cache_directory()};
while (not stop_requested_ && cache_size_ > max_cache_size &&
cache_dir.count() > 1U) {
event_system::instance().raise<max_cache_size_reached>(cache_size_, event_system::instance().raise<max_cache_size_reached>(cache_size_,
max_cache_size); max_cache_size);
if (not should_wait) { if (not should_wait) {