Remove unused wait_binlog_replay_finish.

GitOrigin-RevId: 3b48057703b70f8b4d9ec8b17b14ea75418bda4c
This commit is contained in:
levlam 2020-01-07 03:38:10 +03:00
parent 52651a2efb
commit f7caca6023
2 changed files with 1 additions and 16 deletions

View File

@ -12,7 +12,6 @@
#include "td/telegram/TdParameters.h"
#include "td/actor/actor.h"
#include "td/actor/Condition.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/SchedulerLocalStorage.h"
@ -337,14 +336,6 @@ class Global : public ActorContext {
#endif
}
void wait_binlog_replay_finish(Promise<> promise) {
binlog_replay_finish_.wait(std::move(promise));
}
void on_binlog_replay_finish() {
binlog_replay_finish_.set_true();
}
void set_close_flag() {
close_flag_ = true;
}
@ -371,7 +362,6 @@ class Global : public ActorContext {
std::shared_ptr<DhConfig> dh_config_;
unique_ptr<TdDb> td_db_;
Condition binlog_replay_finish_;
ActorId<Td> td_;
ActorId<AnimationsManager> animations_manager_;

View File

@ -4376,15 +4376,12 @@ Status Td::init(DbKey key) {
// 1. Actors must receive all binlog events before other queries.
//
// -- All actors have one "entry point". So there is only one way to send query to them. So all queries are ordered
// for each Actor.
//
// for each Actor.
//
// 2. An actor must not make some decisions before all binlog events are processed.
// For example, SecretChatActor must not send RequestKey, before it receives logevent with RequestKey and understands
// that RequestKey was already sent.
//
// -- G()->wait_binlog_replay_finish(Promise<>);
//
// 3. During replay of binlog some queries may be sent to other actors. They shouldn't process such events before all
// their binlog events are processed. So actor may receive some old queries. It must be in it's actual state in
// orded to handle them properly.
@ -4403,8 +4400,6 @@ Status Td::init(DbKey key) {
send_closure_later(notification_manager_actor_, &NotificationManager::on_binlog_events,
std::move(events.to_notification_manager));
// NB: be very careful. This notification may be received before all binlog events are.
G()->on_binlog_replay_finish();
send_closure(secret_chats_manager_, &SecretChatsManager::binlog_replay_finish);
VLOG(td_init) << "Ping datacenter";