danielfm / pybreaker

Python implementation of the Circuit Breaker pattern.
BSD 3-Clause "New" or "Revised" License
508 stars 74 forks source link

TTL on Redis #69

Open Kludex opened 2 years ago

Kludex commented 2 years ago

Currently, there's no expire time on the keys created on Redis. I'm concerned about orphan keys during the lifetime of the application. A full clean can be performed from time to time... But I guess we can also enable a TTL parameter on those.

To be specific, image I create a namespace "potato", then I'll have the key "potato:pybreaker:state". If I decide to change the namespace, I'll have the previous key being orphan.

danielfm commented 2 years ago

I imagine those keys would consume very little space in a Redis server, but having a way to set a TTL wouldn't hurt.