Rename save_system_time to save_server_time.
GitOrigin-RevId: 9ffc8414c74872c7807faa85071818a0993aca87
This commit is contained in:
parent
22514eeeec
commit
935161c20e
@ -127,7 +127,7 @@ void Global::update_server_time_difference(double diff) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Global::save_system_time() {
|
void Global::save_server_time() {
|
||||||
auto t = Time::now();
|
auto t = Time::now();
|
||||||
if (system_time_saved_at_.load(std::memory_order_relaxed) + 10 < t) {
|
if (system_time_saved_at_.load(std::memory_order_relaxed) + 10 < t) {
|
||||||
system_time_saved_at_ = t;
|
system_time_saved_at_ = t;
|
||||||
|
@ -144,8 +144,8 @@ class Global : public ActorContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void update_server_time_difference(double diff);
|
void update_server_time_difference(double diff);
|
||||||
void save_system_time();
|
|
||||||
void do_save_server_time_difference();
|
void save_server_time();
|
||||||
|
|
||||||
double get_server_time_difference() const {
|
double get_server_time_difference() const {
|
||||||
return server_time_difference_.load(std::memory_order_relaxed);
|
return server_time_difference_.load(std::memory_order_relaxed);
|
||||||
@ -426,6 +426,8 @@ class Global : public ActorContext {
|
|||||||
|
|
||||||
std::unordered_map<int64, int64> location_access_hashes_;
|
std::unordered_map<int64, int64> location_access_hashes_;
|
||||||
|
|
||||||
|
void do_save_server_time_difference();
|
||||||
|
|
||||||
void do_close(Promise<> on_finish, bool destroy_flag);
|
void do_close(Promise<> on_finish, bool destroy_flag);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -577,7 +577,7 @@ void ConnectionCreator::on_online(bool online_flag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionCreator::on_pong(size_t hash) {
|
void ConnectionCreator::on_pong(size_t hash) {
|
||||||
G()->save_system_time();
|
G()->save_server_time();
|
||||||
if (active_proxy_id_ != 0) {
|
if (active_proxy_id_ != 0) {
|
||||||
auto now = G()->unix_time();
|
auto now = G()->unix_time();
|
||||||
int32 &last_used = proxy_last_used_date_[active_proxy_id_];
|
int32 &last_used = proxy_last_used_date_[active_proxy_id_];
|
||||||
@ -1007,7 +1007,7 @@ void ConnectionCreator::client_add_connection(size_t hash, Result<unique_ptr<mtp
|
|||||||
|
|
||||||
void ConnectionCreator::client_wakeup(size_t hash) {
|
void ConnectionCreator::client_wakeup(size_t hash) {
|
||||||
LOG(INFO) << tag("hash", format::as_hex(hash)) << " wakeup";
|
LOG(INFO) << tag("hash", format::as_hex(hash)) << " wakeup";
|
||||||
G()->save_system_time();
|
G()->save_server_time();
|
||||||
client_loop(clients_[hash]);
|
client_loop(clients_[hash]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user