Closed HansGlimmerfors closed 1 month ago
…hex.fetch!/4 when options are provided
doctest from cachex.ex:
iex> Cachex.fetch(:my_cache, "missing_key_expires", fn(key) -> ...> { :commit, String.reverse(key), expire: :timer.seconds(60) } ...> end) { :commit, "seripxe_yek_gnissim", [expire: 60000] }
The unsafe version Cachex.fetch!/4 will fail when providing options as in the example above due to a FunctionClauseError. This PR adds the missing function clause.
You know, I thought more about this and this is actually a bug in the first place; it shouldn't be returning the options.
I've fixed it over here, but thank you very much for your contribution and raising this as an issue!
…hex.fetch!/4 when options are provided
doctest from cachex.ex:
The unsafe version Cachex.fetch!/4 will fail when providing options as in the example above due to a FunctionClauseError. This PR adds the missing function clause.