Redcrumbs icon indicating copy to clipboard operation
Redcrumbs copied to clipboard

Option to limit the number of crumbs.

Open esbanarango opened this issue 11 years ago • 1 comments

It would be great to set an option to limit the number of crumbs. So for example we can set a total of X crumbs and it will overwrite the oldest ones when it reach the total. This would be when you have limitations on your Redis space.

esbanarango avatar Dec 31 '14 08:12 esbanarango

The thing is that you can do this with your Redis setup by enabling the allkeys-lru eviction policy.

You can also set a mortality period in the Redcrumbs config and activity will be automatically expired.

You'd need to keep an eye on the lifetime of the least-used-key (how long an activity lives when it is created once and never used again) as your application grows.

Anyone who needs more finely grained control could subclass the Redcrumbs::Crumb class and introduce the behaviour they need so I'm reluctant to introduce too much complexity to the gem.

JonMidhir avatar Jan 06 '15 13:01 JonMidhir