From 2511dda79df82c42fc192248355ed26aa20772ff Mon Sep 17 00:00:00 2001 From: Mixficsol <838844609@qq.com> Date: Sat, 29 Jul 2023 20:05:46 +0800 Subject: [PATCH] Optimized code logic (#1834) --- src/pika_server.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pika_server.cc b/src/pika_server.cc index 6af2391f56..d567cef5f0 100644 --- a/src/pika_server.cc +++ b/src/pika_server.cc @@ -1536,11 +1536,8 @@ void PikaServer::AutoResumeDB() { uint64_t free_size = disk_info.f_bsize * disk_info.f_bfree; uint64_t total_size = disk_info.f_bsize * disk_info.f_blocks; double disk_use_ratio = 1.0 - static_cast(free_size) / static_cast(total_size); - if (disk_use_ratio > min_check_resume_ratio) { + if (disk_use_ratio > min_check_resume_ratio && free_size > least_free_size) { gettimeofday(&last_check_resume_time_, nullptr); - if (disk_use_ratio < min_check_resume_ratio || free_size < least_free_size) { - return; - } std::map background_errors; std::shared_lock db_rwl(g_pika_server->dbs_rw_);