Do not send uqeries in QueryCombiner when closing.

GitOrigin-RevId: 1bf74cad094cdedb28c7d198f962ecc352a2c574
This commit is contained in:
levlam 2019-04-01 20:41:27 +03:00
parent 71d80f73bf
commit e3ca852a92

View File

@ -6,6 +6,8 @@
//
#include "td/telegram/QueryCombiner.h"
#include "td/telegram/Global.h"
#include "td/utils/logging.h"
#include "td/utils/Time.h"
@ -72,6 +74,10 @@ void QueryCombiner::on_get_query_result(int64 query_id, Result<Unit> &&result) {
}
void QueryCombiner::loop() {
if (G()->close_flag()) {
return;
}
auto now = Time::now();
if (now < next_query_time_) {
set_timeout_in(next_query_time_ - now + 0.001);