From 408aa95f768b352898036190f7a557aab2714ba2 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 22 Feb 2022 23:06:37 +0300 Subject: [PATCH] Remove preloading of users from database before adding them from binlog. It makes no sense, because users will be rewritten by binlog data anyway. --- td/telegram/ContactsManager.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index f309965ab..586471fdd 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -8523,20 +8523,6 @@ void ContactsManager::on_binlog_user_event(BinlogEvent &&event) { return; } - if (!log_event.u.is_received) { - // we must preload received inaccessible users from database in order to not save - // the min-user to the database and to not override access_hash and another info - if (!have_user_force(user_id)) { - LOG(INFO) << "Receive inaccessible " << user_id << " from binlog"; - } - } else if (log_event.u.is_contact && !are_contacts_loaded_) { - // preload contact users from database to know that is_contact didn't changed - // and the list of contacts doesn't need to be saved to the database - if (!have_user_force(user_id)) { - LOG(INFO) << "Receive contact " << user_id << " for the first time from binlog"; - } - } - LOG(INFO) << "Add " << user_id << " from binlog"; User *u = add_user(user_id, "on_binlog_user_event"); *u = std::move(log_event.u); // users come from binlog before all other events, so just add them