Skip to content

Commit

Permalink
Always close socket in Follower#close
Browse files Browse the repository at this point in the history
  • Loading branch information
spuun committed Dec 12, 2024
1 parent 5c12a40 commit fffd6db
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lavinmq/clustering/follower.cr
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module LavinMQ
end
ensure
begin
@lz4.close
lz4.close unless lz4.closed?
@socket.close
rescue IO::Error
# ignore connection errors while closing
Expand Down Expand Up @@ -186,6 +186,9 @@ module LavinMQ
Log.warn { "Timeout waiting for follower to be in sync" }
end
end
ensure
@lz4.close unless @lz4.closed?
@socket.close
end

def to_json(json : JSON::Builder)
Expand Down

0 comments on commit fffd6db

Please sign in to comment.