mirror of
https://github.com/tdlight-team/tdlight-telegram-bot-api.git
synced 2024-12-29 13:45:49 +01:00
Allow faster reopen for bots that were successfully authorized.
This commit is contained in:
parent
e7b81da50b
commit
d8c8291886
@ -6353,9 +6353,9 @@ void Client::finish_closing() {
|
|||||||
|
|
||||||
auto timeout = [&] {
|
auto timeout = [&] {
|
||||||
if (next_authorization_time_ <= 0.0) {
|
if (next_authorization_time_ <= 0.0) {
|
||||||
return 600.0;
|
return was_authorized_ && authorization_date_ < get_unix_time() - 1800 ? 1.0 : 1800.0;
|
||||||
}
|
}
|
||||||
return td::min(next_authorization_time_ - td::Time::now(), 600.0);
|
return td::min(next_authorization_time_ - td::Time::now(), 1800.0);
|
||||||
}();
|
}();
|
||||||
set_timeout_in(timeout);
|
set_timeout_in(timeout);
|
||||||
LOG(INFO) << "Keep client opened for " << timeout << " seconds";
|
LOG(INFO) << "Keep client opened for " << timeout << " seconds";
|
||||||
|
Loading…
Reference in New Issue
Block a user