Send less updates repeatedly in getUpdates.

This commit is contained in:
levlam 2022-10-23 11:34:24 +03:00
parent bb8b7a6702
commit c1db2380bd

View File

@ -8518,6 +8518,9 @@ td::Status Client::process_get_updates_query(PromisedQueryPtr &query) {
if (offset == previous_get_updates_offset_ && timeout < 3 && now < previous_get_updates_start_time_ + 3.0) { if (offset == previous_get_updates_offset_ && timeout < 3 && now < previous_get_updates_start_time_ + 3.0) {
timeout = 3; timeout = 3;
} }
if (offset == previous_get_updates_offset_ && now < previous_get_updates_start_time_ + 0.5) {
limit = 1;
}
previous_get_updates_offset_ = offset; previous_get_updates_offset_ = offset;
previous_get_updates_start_time_ = now; previous_get_updates_start_time_ = now;
do_get_updates(offset, limit, timeout, std::move(query)); do_get_updates(offset, limit, timeout, std::move(query));