Skip to content

Commit

Permalink
adjust reconnect to first force the socket to disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
jjcarstens committed Oct 1, 2021
1 parent 677faf7 commit 32cc9a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/nerves_hub_link/socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ defmodule NervesHubLink.Socket do

@impl Slipstream
def handle_cast(:reconnect, socket) do
{:ok, socket} =
socket
|> disconnect()
|> await_disconnect()

{:ok, socket} = reconnect(socket)

{:noreply, socket}
end

Expand Down

0 comments on commit 32cc9a9

Please sign in to comment.