From 1ec733a3f817404fe72c0f50c0bdb5b17fe76cc5 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 14 Sep 2023 16:57:28 +0300 Subject: [PATCH] Don't update CPU statistics before returning it to avoid synchronous open of "/proc/stat". --- telegram-bot-api/ClientManager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/telegram-bot-api/ClientManager.cpp b/telegram-bot-api/ClientManager.cpp index b1ea210..0f4458c 100644 --- a/telegram-bot-api/ClientManager.cpp +++ b/telegram-bot-api/ClientManager.cpp @@ -230,7 +230,6 @@ void ClientManager::get_stats(td::Promise promise, LOG(INFO) << "Failed to get memory statistics: " << r_mem_stat.error(); } - ServerCpuStat::update(td::Time::now()); auto cpu_stats = ServerCpuStat::instance().as_vector(td::Time::now()); for (auto &stat : cpu_stats) { sb << stat.key_ << "\t" << stat.value_ << '\n';