From 90cc7a5f9c15af3292d082cfd5f53fcafc2ef470 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 24 Jan 2024 16:31:47 +0300 Subject: [PATCH] Improve logging. --- td/telegram/net/DcAuthManager.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/td/telegram/net/DcAuthManager.cpp b/td/telegram/net/DcAuthManager.cpp index ad99e72ae..a24a1c81f 100644 --- a/td/telegram/net/DcAuthManager.cpp +++ b/td/telegram/net/DcAuthManager.cpp @@ -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"; } }