branch-2.1: [fix](cache prune) Fix _stale_sweep_time_s not working when its value less than 0 #42281 (#51189)

Cherry-picked from #42281

Co-authored-by: zhiqiang <seuhezhiqiang@163.com>
This commit is contained in:
github-actions[bot]
2025-06-05 12:14:24 +08:00
committed by GitHub
parent 831d2c148a
commit c8daf2e4fb

View File

@ -120,7 +120,7 @@ public:
void prune_stale() override {
COUNTER_SET(_freed_entrys_counter, (int64_t)0);
COUNTER_SET(_freed_memory_counter, (int64_t)0);
if (_stale_sweep_time_s <= 0 && _cache == ExecEnv::GetInstance()->get_dummy_lru_cache()) {
if (_stale_sweep_time_s <= 0 || _cache == ExecEnv::GetInstance()->get_dummy_lru_cache()) {
return;
}
if (exceed_prune_limit()) {