Improve logging.

This commit is contained in:
levlam 2024-01-24 16:31:47 +03:00
parent 741c80cf13
commit 90cc7a5f9c
1 changed files with 6 additions and 5 deletions

View File

@ -198,17 +198,18 @@ void DcAuthManager::destroy_loop() {
if (!need_destroy_auth_key_) {
return;
}
bool is_ready{true};
bool is_ready = true;
for (auto &dc : dcs_) {
is_ready &= dc.auth_key_state == AuthKeyState::Empty;
if (dc.auth_key_state != AuthKeyState::Empty) {
is_ready = false;
VLOG(dc) << "Auth key in " << dc.dc_id << " in state " << dc.auth_key_state << " must be destroyed";
}
}
if (is_ready) {
VLOG(dc) << "Destroy auth keys loop is ready, all keys are destroyed";
VLOG(dc) << "All keys were destroyed";
destroy_promise_.set_value(Unit());
need_destroy_auth_key_ = false;
} else {
VLOG(dc) << "DC is not ready for destroying auth key";
}
}