Use CREATE_OK_REQUEST_PROMISE instead of simple RequestOnceActor.

GitOrigin-RevId: 7ba8db1c05ed06b9824e482ba6c12024c5a0106d
This commit is contained in:
levlam 2018-06-29 00:06:17 +03:00
parent 2f60d194cb
commit 139a858d80
6 changed files with 139 additions and 860 deletions

View File

@ -221,7 +221,7 @@ void SequenceDispatcher::tear_down() {
continue;
}
data.state_ = State::Dummy;
data.query_->set_error(Status::Error(500, "Internal Server Error: closing"));
data.query_->set_error(Status::Error(500, "Request aborted"));
do_finish(data);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -568,7 +568,7 @@ class Td final : public NetQueryCallback {
void on_request(uint64 id, td_api::setChatTitle &request);
void on_request(uint64 id, td_api::setChatPhoto &request);
void on_request(uint64 id, const td_api::setChatPhoto &request);
void on_request(uint64 id, td_api::setChatDraftMessage &request);

View File

@ -2493,7 +2493,7 @@ void FileManager::hangup() {
while (!queries_container_.empty()) {
auto ids = queries_container_.ids();
for (auto id : ids) {
on_error(id, Status::Error(500, "Internal Server Error: closing"));
on_error(id, Status::Error(500, "Request aborted"));
}
}
is_closed_ = true;

View File

@ -109,7 +109,7 @@ void NetQueryDelayer::on_slot_event(uint64 id) {
void NetQueryDelayer::tear_down() {
container_.for_each([](auto id, auto &query_slot) {
query_slot.query_->set_error(Status::Error(500, "Internal Server Error: closing"));
query_slot.query_->set_error(Status::Error(500, "Request aborted"));
G()->net_query_dispatcher().dispatch(std::move(query_slot.query_));
});
}

View File

@ -42,7 +42,7 @@ void NetQueryDispatcher::complete_net_query(NetQueryPtr net_query) {
void NetQueryDispatcher::dispatch(NetQueryPtr net_query) {
net_query->debug("dispatch");
if (stop_flag_.load(std::memory_order_relaxed)) {
net_query->set_error(Status::Error(500, "Internal Server Error: closing"));
net_query->set_error(Status::Error(500, "Request aborted"));
return complete_net_query(std::move(net_query));
}