Skip to content

Commit

Permalink
fix timeout (#1621)
Browse files Browse the repository at this point in the history
Signed-off-by: turuslan <turuslan.devbox@gmail.com>
  • Loading branch information
turuslan authored May 18, 2023
1 parent aea722a commit c87ef1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/api/transport/impl/ws/ws_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ namespace kagome::api {
stream_.next_layer().buffer(),
http_request_->get(),
[self{shared_from_this()}](boost::system::error_code ec, size_t) {
self->stream_.next_layer().next_layer().expires_never();
if (ec) {
self->httpClose();
return;
Expand Down Expand Up @@ -313,10 +314,12 @@ namespace kagome::api {

void WsSession::httpWrite() {
http_response_->prepare_payload();
stream_.next_layer().next_layer().expires_after(config_.operation_timeout);
boost::beast::http::async_write(
stream_.next_layer(),
*http_response_,
[self = shared_from_this()](boost::system::error_code ec, size_t) {
self->stream_.next_layer().next_layer().expires_never();
if (ec) {
self->httpClose();
return;
Expand Down

0 comments on commit c87ef1c

Please sign in to comment.