Open
Description
Description
Otter seems to be internally using Unix timestamps in seconds for expiry. It still allows setting TTL in any time.Duration. Then, if for example Duration of time.Millisecond TTL is used, the cache expiry does not really work as intended.
To Reproduce
Steps to reproduce the behavior:
- Use WithTTL(time.Millisecond * 100)
- Set to cache
- Sleep for 200ms
- Can still read the entry
Expected behavior
Either do not allow setting under 1 second TTL or use more granular time than seconds for expiry.
Activity