mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-16 04:35:33 +00:00
Slowly recheck webhook IP addresses after loading them from database.
This commit is contained in:
parent
9a7a293a84
commit
f169ae654c
@ -691,7 +691,12 @@ void WebhookActor::handle(td::unique_ptr<td::HttpQuery> response) {
|
||||
void WebhookActor::start_up() {
|
||||
max_loaded_updates_ = max_connections_ * 2;
|
||||
|
||||
next_ip_address_resolve_time_ = last_success_time_ = td::Time::now() - 3600;
|
||||
last_success_time_ = td::Time::now() - 2 * IP_ADDRESS_CACHE_TIME;
|
||||
if (from_db_flag_) {
|
||||
next_ip_address_resolve_time_ = td::Time::now() + td::Random::fast(0, IP_ADDRESS_CACHE_TIME);
|
||||
} else {
|
||||
next_ip_address_resolve_time_ = last_success_time_;
|
||||
}
|
||||
|
||||
active_new_connection_flood_.add_limit(0.5, 10);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user