Skip to content

Commit

Permalink
Match that a list of predictions isnt empty (#1931)
Browse files Browse the repository at this point in the history
* match that a list of predictions isnt empty

* ocd about alpha

* add guard for list
  • Loading branch information
anthonyshull authored Mar 19, 2024
1 parent 7a0f9e4 commit aece8b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/predictions/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ defmodule Predictions.Repo do
end
end

@decorate cacheable(cache: @cache, on_error: :nothing, opts: [ttl: @ttl])
@decorate cacheable(
cache: @cache,
match: fn lst -> is_list(lst) && lst != [] end,
on_error: :nothing,
opts: [ttl: @ttl]
)
defp cache_fetch(opts) do
fetch(opts)
end
Expand Down

0 comments on commit aece8b5

Please sign in to comment.