Closed tbm206 closed 8 months ago
When the cache is set through the normal workflow within the Phoenix app, it works just fine. However, I want the flexibility to set/view the cache from iex
during development.
@tbm206 as far as I know, there's nothing that should be inside Cachex causing this. It's just ETS behind the scenes; if you can even put things into your cache from iex
, then that alone proves that it's the same instance (otherwise you'd have to start a cache inside iex
).
Which version of OTP is this using? (OTP as in Erlang, not your passcode stuff).
@tbm206 just following up to see if you have any further information on this?
Going to tentatively close this as I cannot reproduce and there has been no follow up. Feel free to re-open if you can reproduce!
Originally posted on Elixirforum
I’m exploring using Cachex to implement a simple one time password (OTP). In its simplest form, there is a custom Plug that looks like the following:
The issue here is that Cachex.get(:passcode, :"#{access_code}" will always give me nil. Similarly, if I use Cachex.keys(:passcode), it will return an empty list while I’m sure there are keys that I had added via iex.
Here’s how Cachex is initialised in application.ex
I have a feeling there is something missing in the setup?
Further details
I run phoenix in a docker container. I then exec into it and run iex -S mix. That has worked well with other tasks so far but maybe Cachex is different.
The exact command I use is:
What’s confusing is that the :passcode cache is available in the interactive terminal.