Do not start GetWebPageQuery on closing.

GitOrigin-RevId: 199f02aa226f0427d591c3699b2da12ce5be2948
This commit is contained in:
levlam 2019-12-13 19:29:14 +03:00
parent 3ec96b4c30
commit 60a95186f5

View File

@ -829,6 +829,10 @@ void WebPagesManager::reload_web_page_instant_view(WebPageId web_page_id) {
true, std::move(result));
});
if (G()->close_flag()) {
return promise.set_error(Status::Error(500, "Request aborted"));
}
td_->create_handler<GetWebPageQuery>(std::move(promise))
->send(web_page->url, web_page->instant_view.is_full ? web_page->instant_view.hash : 0);
}
@ -1044,6 +1048,10 @@ void WebPagesManager::on_load_web_page_by_url_from_database(WebPageId web_page_i
}
void WebPagesManager::reload_web_page_by_url(const string &url, Promise<Unit> &&promise) {
if (G()->close_flag()) {
return promise.set_error(Status::Error(500, "Request aborted"));
}
LOG(INFO) << "Reload url \"" << url << '"';
td_->create_handler<GetWebPageQuery>(std::move(promise))->send(url, 0);
}