Skip to content

Commit

Permalink
Fix supporting Elixir v1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmach committed Aug 1, 2024
1 parent 35aec22 commit 37ed548
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/req/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,12 @@ defmodule Req.Utils do
stream = %File.Stream{} ->
filename = Path.basename(stream.path)

# TODO: Simplify when we require Elixir v1.15
size =
if stream.node == node() do
if not Map.has_key?(stream, :node) or stream.node == node() do
File.stat!(stream.path).size
else
:erpc.call(stream.node, File, :stat!, [stream.path]).size
:erpc.call(stream.node, fn -> File.stat!(stream.path).size end)
end

options =
Expand Down

0 comments on commit 37ed548

Please sign in to comment.