Skip to content

Commit

Permalink
change sandbox return (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
CorneliaKelinske committed May 26, 2023
1 parent fc07e27 commit ee2925a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/cache/sandbox.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ defmodule Cache.Sandbox do

def hash_get_all(cache_name, key, _opts) do
Agent.get(cache_name, fn state ->
{:ok, state[key]}
case state[key] do
nil -> {:ok, %{}}
value -> {:ok, value}
end
end)
end

Expand Down

0 comments on commit ee2925a

Please sign in to comment.