SessionProxy: bugfix

GitOrigin-RevId: b2cdc985d4465cdd19f85d024a5de9d8e882e8f0
This commit is contained in:
Arseny Smirnov 2018-11-01 19:34:18 +03:00
parent 1cb68fab96
commit 03604bb367

View File

@ -154,14 +154,16 @@ void SessionProxy::open_session(bool force) {
if (!session_.empty()) {
return;
}
if (auth_state_ == AuthState::Empty && need_destroy_) {
return;
}
if (auth_state_ != AuthState::OK && need_wait_for_key_) {
return;
}
if (!is_main_ && pending_queries_.empty() && !need_destroy_) {
return;
if (!force) {
if (auth_state_ == AuthState::Empty && need_destroy_) {
return;
}
if (auth_state_ != AuthState::OK && need_wait_for_key_) {
return;
}
if (!is_main_ && pending_queries_.empty() && !need_destroy_) {
return;
}
}
CHECK(session_.empty());