Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubwro committed Oct 2, 2023
1 parent 9820326 commit 4ad27cd
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/connection/reconnect.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
function socket_reconnect(nc::Connection, host, port)
sock = retry(Sockets.connect, delays=SOCKET_CONNECT_DELAYS)(port)
info_msg = next_protocol_message(sock)
if !(info_msg isa Info)
error("Expected INFO, received $info_msg")
end
info_msg isa Info || error("Expected INFO, received $info_msg")
process(nc, info_msg)
sock
end
Expand Down Expand Up @@ -43,13 +41,8 @@ function reconnect(nc::Connection, host, port, con_msg)
try
wait(c)
catch err
if istaskfailed(receiver_task)
@error "Receiver task failed:" receiver_task.result
end
if istaskfailed(sender_task)
@error "Sender task failed:" sender_task.result
end

taskfailed(receiver_task) && @error "Receiver task failed:" receiver_task.result
istaskfailed(sender_task) && @error "Sender task failed:" sender_task.result
close(nc.outbox)
close(sock)
end
Expand Down

0 comments on commit 4ad27cd

Please sign in to comment.