mirror of
https://github.com/PaiGramTeam/telegram-bot-api.git
synced 2024-11-16 04:35:33 +00:00
Make watchdog timeouts more precise.
This commit is contained in:
parent
8b2b62bd6f
commit
89383695ed
@ -531,7 +531,7 @@ void ClientManager::raw_event(const td::Event::Raw &event) {
|
|||||||
|
|
||||||
void ClientManager::timeout_expired() {
|
void ClientManager::timeout_expired() {
|
||||||
send_closure(watchdog_id_, &Watchdog::kick);
|
send_closure(watchdog_id_, &Watchdog::kick);
|
||||||
set_timeout_in(WATCHDOG_TIMEOUT / 2);
|
set_timeout_in(WATCHDOG_TIMEOUT / 10);
|
||||||
|
|
||||||
double now = td::Time::now();
|
double now = td::Time::now();
|
||||||
if (now > next_tqueue_gc_time_) {
|
if (now > next_tqueue_gc_time_) {
|
||||||
|
@ -562,7 +562,7 @@ int main(int argc, char *argv[]) {
|
|||||||
if (now >= start_time + 600) {
|
if (now >= start_time + 600) {
|
||||||
auto guard = sched.get_main_guard();
|
auto guard = sched.get_main_guard();
|
||||||
send_closure(watchdog_id, &Watchdog::kick);
|
send_closure(watchdog_id, &Watchdog::kick);
|
||||||
next_watchdog_kick_time = now + WATCHDOG_TIMEOUT / 2;
|
next_watchdog_kick_time = now + WATCHDOG_TIMEOUT / 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!need_dump_statistics.test_and_set() || now > last_dump_time + 300.0) {
|
if (!need_dump_statistics.test_and_set() || now > last_dump_time + 300.0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user