This commit is contained in:
Andrea Cavalli 2020-10-25 20:52:25 +01:00
parent 14b8f24954
commit 70b9b6764f

View File

@ -79,7 +79,7 @@ void MemoryManager::tear_down() {
} }
void MemoryManager::init() { void MemoryManager::init() {
if (!td_->auth_manager_->is_authorized() || td_->auth_manager_->is_bot() || G()->close_flag()) { if (!td_->auth_manager_->is_authorized() || G()->close_flag()) {
return; return;
} }
LOG(INFO) << "Init MemoryManager"; LOG(INFO) << "Init MemoryManager";
@ -94,63 +94,63 @@ void MemoryManager::get_memory_stats(bool full, Promise<MemoryStats> promise) co
vector<string> output = {"{\"memory_stats\":{"}; vector<string> output = {"{\"memory_stats\":{"};
output.push_back("\"messages_manager_\":["); output.push_back("\"messages_manager_\":{");
td_->messages_manager_->memory_stats(output); td_->messages_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"contacts_manager_\":["); output.push_back("\"contacts_manager_\":{");
td_->contacts_manager_->memory_stats(output); td_->contacts_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"web_pages_manager_\":["); output.push_back("\"web_pages_manager_\":{");
td_->web_pages_manager_->memory_stats(output); td_->web_pages_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"stickers_manager_\":["); output.push_back("\"stickers_manager_\":{");
td_->stickers_manager_->memory_stats(output); td_->stickers_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"documents_manager_\":["); output.push_back("\"documents_manager_\":{");
td_->documents_manager_->memory_stats(output); td_->documents_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"video_notes_manager_\":["); output.push_back("\"video_notes_manager_\":{");
td_->video_notes_manager_->memory_stats(output); td_->video_notes_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"videos_manager_\":["); output.push_back("\"videos_manager_\":{");
td_->videos_manager_->memory_stats(output); td_->videos_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"audios_manager_\":["); output.push_back("\"audios_manager_\":{");
td_->audios_manager_->memory_stats(output); td_->audios_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"animations_manager_\":["); output.push_back("\"animations_manager_\":{");
td_->animations_manager_->memory_stats(output); td_->animations_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back(","); output.push_back(",");
output.push_back("\"file_manager_\":["); output.push_back("\"file_manager_\":{");
td_->file_manager_->memory_stats(output); td_->file_manager_->memory_stats(output);
output.push_back("]"); output.push_back("}");
output.push_back("}}"); output.push_back("}}");