From c5f3b2223c88e9c7d05d76184aa46b6a57e462e7 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 22 Feb 2020 19:31:08 +0300 Subject: [PATCH] Add more logging in to_unix_time. GitOrigin-RevId: 1e191c31e4be4a29584844f27b098a21811daffd --- td/telegram/Global.cpp | 8 ++++++-- td/telegram/Global.h | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/td/telegram/Global.cpp b/td/telegram/Global.cpp index d5417e882..c3421daed 100644 --- a/td/telegram/Global.cpp +++ b/td/telegram/Global.cpp @@ -102,6 +102,9 @@ Status Global::init(const TdParameters ¶meters, ActorId td, unique_ptr system_time) { double time_backwards_fix = saved_diff.system_time - system_time; @@ -129,8 +132,9 @@ Status Global::init(const TdParameters ¶meters, ActorId td, unique_ptr(server_time); } diff --git a/td/telegram/Global.h b/td/telegram/Global.h index 9cfc0f3e6..6fbf7223c 100644 --- a/td/telegram/Global.h +++ b/td/telegram/Global.h @@ -398,6 +398,8 @@ class Global : public ActorContext { std::atomic dns_time_difference_was_updated_{false}; std::atomic close_flag_{false}; std::atomic system_time_saved_at_{-1e10}; + double saved_diff_ = 0.0; + double saved_system_time_ = 0.0; #if !TD_HAVE_ATOMIC_SHARED_PTR std::mutex dh_config_mutex_; @@ -418,7 +420,7 @@ class Global : public ActorContext { std::unordered_map location_access_hashes_; - static int32 to_unix_time(double server_time); + int32 to_unix_time(double server_time) const; void do_save_server_time_difference();