Properly init MessagesManager.
GitOrigin-RevId: 10bd6a41a479389afdbf6d621025bba766f8e850
This commit is contained in:
parent
78a0a37afb
commit
027c1eafc4
@ -8735,6 +8735,15 @@ void MessagesManager::tear_down() {
|
||||
}
|
||||
|
||||
void MessagesManager::start_up() {
|
||||
init();
|
||||
}
|
||||
|
||||
void MessagesManager::init() {
|
||||
if (is_inited_) {
|
||||
return;
|
||||
}
|
||||
is_inited_ = true;
|
||||
|
||||
always_wait_for_mailbox();
|
||||
|
||||
start_time_ = Time::now();
|
||||
@ -17925,7 +17934,8 @@ vector<NotificationGroupKey> MessagesManager::get_message_notification_group_key
|
||||
if (!G()->parameters().use_message_db) {
|
||||
return {};
|
||||
}
|
||||
CHECK(start_time_ != 0); // ensure that MessagesManager was already inited in start_up
|
||||
|
||||
init();
|
||||
|
||||
VLOG(notifications) << "Trying to load " << limit << " message notification groups from database from "
|
||||
<< from_group_key;
|
||||
|
@ -1790,6 +1790,8 @@ class MessagesManager : public Actor {
|
||||
void loop() override;
|
||||
void tear_down() override;
|
||||
|
||||
void init();
|
||||
|
||||
void ttl_db_loop_start(double server_now);
|
||||
void ttl_db_loop(double server_now);
|
||||
void ttl_db_on_result(Result<std::pair<std::vector<std::pair<DialogId, BufferSlice>>, int32>> r_result, bool dummy);
|
||||
@ -2280,6 +2282,7 @@ class MessagesManager : public Actor {
|
||||
DialogId being_added_dialog_id_;
|
||||
|
||||
double start_time_ = 0;
|
||||
bool is_inited_ = false;
|
||||
|
||||
Td *td_;
|
||||
ActorShared<> parent_;
|
||||
|
Reference in New Issue
Block a user