Skip to content

Commit 54f0d18

Browse files
Merge pull request #107 from harness/FFM-12288
fix: [FFM-12288]: bump lru cache default size
2 parents d32a599 + 9f7de41 commit 54f0d18

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

featureflags/lru_cache.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
from collections import OrderedDict
22
from typing import Any, List
3+
from featureflags.util import log
34

45
from .interface import Cache
56

67

78
class LRUCache(Cache):
8-
def __init__(self, *args: Any, size: int = 1000, **kwargs: Any) -> None:
9+
def __init__(self, *args: Any, size: int = 2500, **kwargs: Any) -> None:
910
self.size = size
1011
init = args
1112
if len(init) > 0:
@@ -25,6 +26,7 @@ def __setitem__(self, key: str, value: Any) -> Any:
2526
while len(self.cache) > self.size:
2627
oldkey = next(iter(self.cache))
2728
del self.cache[oldkey]
29+
log.warning("key evicted from cache: %s", oldkey)
2830

2931
def __len__(self) -> int:
3032
return len(self.cache)

0 commit comments

Comments
 (0)