Skip to content

Commit

Permalink
Improve cache usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmj committed Jun 3, 2024
1 parent dfb3b41 commit f7cea63
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/hex/registry/server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,8 @@ defmodule Hex.Registry.Server do
end

defp write_result(other, repo, package, %{ets: tid}) do
cached? = !!:ets.lookup(tid, {:versions, package})
cached? = :ets.lookup(tid, {:versions, repo, package}) != []
print_error(other, repo, package, cached?)

unless cached? do
raise "Stopping due to errors"
end
end

defp print_error(result, repo, package, cached?) do
Expand Down

0 comments on commit f7cea63

Please sign in to comment.