Skip to content

Commit

Permalink
Close tempfile after rename
Browse files Browse the repository at this point in the history
  • Loading branch information
carlhoerberg authored and viktorerlingsson committed Oct 28, 2024
1 parent a42b4f4 commit e6abe2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lavinmq/clustering/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ module LavinMQ
f = @files["#{filename}.tmp"]
IO.copy(lz4, f, len) == len || raise IO::EOFError.new("Full file not received")
f.rename f.path[0..-5]
@files.delete("#{filename}.tmp")
@files.delete("#{filename}.tmp").try &.close
end
ack_bytes = len.abs + sizeof(Int64) + filename_len + sizeof(Int32)
acks.send(ack_bytes)
Expand Down

0 comments on commit e6abe2b

Please sign in to comment.