Destroy HttpQuery on another thread.

This commit is contained in:
levlam 2023-01-23 19:27:19 +03:00
parent 70428fb762
commit d3846adaa2
2 changed files with 7 additions and 0 deletions

View File

@ -114,6 +114,8 @@ class Query final : public td::ListNode {
if (!empty()) { if (!empty()) {
shared_data_->query_list_size_.fetch_sub(1, std::memory_order_relaxed); shared_data_->query_list_size_.fetch_sub(1, std::memory_order_relaxed);
} }
td::Scheduler::instance()->destroy_on_scheduler(SharedData::get_file_gc_scheduler_id(), container_, args_,
headers_, files_, answer_);
} }
} }

View File

@ -590,6 +590,11 @@ void WebhookActor::send_updates() {
} }
void WebhookActor::handle(td::unique_ptr<td::HttpQuery> response) { void WebhookActor::handle(td::unique_ptr<td::HttpQuery> response) {
SCOPE_EXIT {
bool dummy = false;
td::Scheduler::instance()->destroy_on_scheduler(SharedData::get_file_gc_scheduler_id(), response, dummy);
};
auto connection_id = get_link_token(); auto connection_id = get_link_token();
if (response) { if (response) {
VLOG(webhook) << "Got response from connection " << connection_id; VLOG(webhook) << "Got response from connection " << connection_id;