Open main connection before authorization.

This commit is contained in:
levlam 2023-01-16 16:43:07 +03:00
parent f6168879af
commit fcb5e068e0

View File

@ -188,10 +188,13 @@ void SessionProxy::open_session(bool force) {
if (need_destroy_) {
return auth_key_state_ != AuthKeyState::Empty;
}
if (is_main_) {
return true;
}
if (auth_key_state_ != AuthKeyState::OK) {
return false;
}
return is_main_ || !pending_queries_.empty();
return !pending_queries_.empty();
}();
if (!should_open) {
return;