TrueDat Cache application. Provides modules for managing cached data in Redis.
# In your config/config.exs file
config :td_cache, redis_host: "localhost"
# In your application.ex
children = [
# ...
worker(TdCache.CacheCleaner, [config])
]
The TdCache.CacheCleaner
config expect a keyword list with the options:
clean_on_startup
- iftrue
, cleanup will be performed on application startuppatterns
- a list of KEYS patterns to be deleted from Redis
After startup, cleanup can be perfomed programatically by using TdCache.CacheCleaner.clean
.
The test environment expect a clean Redis server to be listening on port 6380.
To start redis as a docker container, run docker-compose up -d redis
.
Run all aplication tests with mix test
.