whitfin / cachex

A powerful caching library for Elixir with support for transactions, fallbacks and expirations
https://hexdocs.pm/cachex/
MIT License
1.6k stars 103 forks source link

Migrate interval/0 to :interval #363

Closed whitfin closed 1 month ago

whitfin commented 1 month ago

This PR migrates interval/0 in Cachex.Warmer to :interval in warmer(). This simplifies the module behaviour, and is more Elixir-y. Hardcoding the interval in the module itself didn't really make sense.

This also makes the interval completely optional, so you can choose to manually warm instead. This makes warming far more flexible for use cases we haven't thought about.