mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2025-01-23 18:27:34 +01:00
Log too old queries.
This commit is contained in:
parent
7de971ec20
commit
ab8edb4de7
@ -124,11 +124,17 @@ void Query::send_request_stat() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Query::send_response_stat() const {
|
void Query::send_response_stat() const {
|
||||||
|
auto now = td::Time::now();
|
||||||
|
if (now - start_timestamp_ >= 100.0) {
|
||||||
|
LOG(WARNING) << "Answer too old query with code " << http_status_code_ << " and answer size " << answer_.size()
|
||||||
|
<< ": " << *this;
|
||||||
|
}
|
||||||
|
|
||||||
if (stat_actor_.empty()) {
|
if (stat_actor_.empty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
send_closure(stat_actor_, &BotStatActor::add_event<ServerBotStat::Response>,
|
send_closure(stat_actor_, &BotStatActor::add_event<ServerBotStat::Response>,
|
||||||
ServerBotStat::Response{state_ == State::OK, answer_.size()}, td::Time::now());
|
ServerBotStat::Response{state_ == State::OK, answer_.size()}, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace telegram_bot_api
|
} // namespace telegram_bot_api
|
||||||
|
Loading…
x
Reference in New Issue
Block a user