From 3a2dc5300ae29a324ebf4fa52999cefb47c9c462 Mon Sep 17 00:00:00 2001 From: Jacob Coffee Date: Sat, 10 Oct 2026 21:34:11 -0500 Subject: [PATCH] fix(cache): treat entries as expired once their expiry time is reached With a TTL of 0, entries stayed readable until the monotonic clock ticked past the set time. Windows' coarse clock made test_ttl_expiration flaky. --- src/litestar_flags/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/litestar_flags/cache.py b/src/litestar_flags/cache.py index 351827e..8b0d6e8 100644 --- a/src/litestar_flags/cache.py +++ b/src/litestar_flags/cache.py @@ -153,7 +153,7 @@ def is_expired(self) -> bool: """ if self.expires_at is None: return False - return time.monotonic() > self.expires_at + return time.monotonic() >= self.expires_at class LRUCache: