# HG changeset patch # User Goffi # Date 1665859020 -7200 # Node ID ebe45ea2df3b6ca55a3801eef7eba70d72a04b7c # Parent 80d29f55ba8b514e12ae578be4dc4b0423c1dabd tools (common/async_utils): set default `maxsize` to 50 in `async_lru` diff -r 80d29f55ba8b -r ebe45ea2df3b sat/tools/common/async_utils.py --- a/sat/tools/common/async_utils.py Sat Oct 15 20:37:00 2022 +0200 +++ b/sat/tools/common/async_utils.py Sat Oct 15 20:37:00 2022 +0200 @@ -27,8 +27,13 @@ log = getLogger(__name__) -def async_lru(maxsize: Optional[int] = None) -> Callable: - """Decorator to cache async function results using LRU algorithm""" +def async_lru(maxsize: Optional[int] = 50) -> Callable: + """Decorator to cache async function results using LRU algorithm + + @param maxsize: maximum number of items to keep in cache. + None to have no limit + + """ def decorator(func: Callable) -> Callable: cache = OrderedDict() async def wrapper(*args) -> Awaitable: