HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/primordial/__pycache__/cacheutils.cpython-39.pyc
a

�,�hz�@sDddlmZmZddlmZmZdZdd�Zefeed�dd�Zd	S)
�)�	lru_cache�wraps)�datetime�	timedelta�cs$i��_t����fdd��}|S)zMA general-use memoizer decorator for class, object, function; supports kwargscs2t|�t|�}|�vr*�|i|���|<�|S)zActual implementation)�str)�args�kwargs�key��cache�obj��F/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/primordial/cacheutils.py�memoizer
szmemoize.<locals>.memoizer)rr)r
rrrr�memoize	s
r)�seconds�maxsizecs��fdd�}|S)a1A decorator that wraps lru_cache and allows the setting of a
    lifetime in seconds, after which the cache will expire
    :param seconds: The number of seconds after which the cache will expire
    :param maxsize: The maximum number of entries in the cache before it will start dropping old entries
    csBt�d����t�d��_t���j�_t���fdd��}|S)N)r)rcs4t���jkr&���t���j�_�|i|��S)N)r�utcnow�
expiration�cache_clear�lifetime)rr	��funcrr�wrapped_func#sz<timed_lru_cache.<locals>.wrapper_cache.<locals>.wrapped_func)rrrrrrr)rr�rrrr�
wrapper_cachesz&timed_lru_cache.<locals>.wrapper_cacher)rrrrrr�timed_lru_cachesrN)	�	functoolsrrrrZDEFAULT_MAXSIZEr�intrrrrr�<module>s