Skip to content

Commit

Permalink
Do not make conditional HTTP request if file is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmj committed Dec 9, 2016
1 parent 1004e06 commit d10fe1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/hex/scm.ex
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ defmodule Hex.SCM do
fetch = fetch_from_lock(lock)

Enum.each(fetch, fn {package, version} ->
etag = Hex.Registry.tarball_etag(package, version)
filename = "#{package}-#{version}.tar"
path = cache_path(filename)
etag = File.exists?(path) && Hex.Registry.tarball_etag(package, version)
Hex.Parallel.run(:hex_fetcher, {:tarball, package, version}, fn ->
filename = "#{package}-#{version}.tar"
path = cache_path(filename)
fetch(filename, path, etag)
end)
end)
Expand Down

0 comments on commit d10fe1a

Please sign in to comment.