DateTime in parameter causes en error
Closed this issue · 2 comments
towhans commented
defmodule Hello do
use Memoize
defmemo my_fun(rr) do
1
end
end
Hello.my_fun( DateTime.from_iso8601("2000-02-29T06:20:00Z") )
** (ArgumentError) argument error
(stdlib) :ets.select_replace(Memoize.CacheStrategy.Default, [{{{Hello, :my_fun, [{:ok, #DateTime<2000-02-29 06:20:00Z>, 0}]}, {:running, #PID<0.806.0>, %{}}}, [], [const: {{Hello, :my_fun, [{:ok, #DateTime<2000-02-29 06:20:00Z>, 0}]}, {:completed, 1, :infinity}}]}])
(memoize) lib/memoize/cache.ex:18: Memoize.Cache.compare_and_swap/3
(memoize) lib/memoize/cache.ex:25: Memoize.Cache.set_result_and_get_waiter_pids/3
(memoize) lib/memoize/cache.ex:56: Memoize.Cache.get_or_run/3
melpon commented
Thank you for reporting. I found that :ets.select_replace/2 does not accept map type. So I will fix to convert map type to list type.
melpon commented
Fixed. Please use memoize version 1.2.3