mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-16 04:35:33 +00:00
Improve getUpdates warnings.
This commit is contained in:
parent
a94b95eac5
commit
221db0fa1f
@ -12225,7 +12225,7 @@ void Client::do_get_updates(int32 offset, int32 limit, int32 timeout, PromisedQu
|
|||||||
CHECK(total_size >= updates.size());
|
CHECK(total_size >= updates.size());
|
||||||
total_size -= updates.size();
|
total_size -= updates.size();
|
||||||
|
|
||||||
bool need_warning = total_size > 0 && (query->start_timestamp() - previous_get_updates_finish_time_ > 10.0);
|
bool need_warning = total_size > 0 && (query->start_timestamp() - previous_get_updates_finish_time_ > 5.0);
|
||||||
if (total_size <= MIN_PENDING_UPDATES_WARNING / 2) {
|
if (total_size <= MIN_PENDING_UPDATES_WARNING / 2) {
|
||||||
if (last_pending_update_count_ > MIN_PENDING_UPDATES_WARNING) {
|
if (last_pending_update_count_ > MIN_PENDING_UPDATES_WARNING) {
|
||||||
need_warning = true;
|
need_warning = true;
|
||||||
@ -12237,7 +12237,8 @@ void Client::do_get_updates(int32 offset, int32 limit, int32 timeout, PromisedQu
|
|||||||
last_pending_update_count_ *= 2;
|
last_pending_update_count_ *= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (need_warning && previous_get_updates_finish_time_ > 0) {
|
if (need_warning && previous_get_updates_finish_time_ > 0 &&
|
||||||
|
query->start_timestamp() > previous_get_updates_finish_time_) {
|
||||||
LOG(WARNING) << "Found " << updates.size() << " updates out of " << (total_size + updates.size())
|
LOG(WARNING) << "Found " << updates.size() << " updates out of " << (total_size + updates.size())
|
||||||
<< " after last getUpdates call " << (query->start_timestamp() - previous_get_updates_finish_time_)
|
<< " after last getUpdates call " << (query->start_timestamp() - previous_get_updates_finish_time_)
|
||||||
<< " seconds ago in " << (td::Time::now() - query->start_timestamp()) << " seconds from "
|
<< " seconds ago in " << (td::Time::now() - query->start_timestamp()) << " seconds from "
|
||||||
|
Loading…
Reference in New Issue
Block a user