|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /opt/cloudlinux/venv/lib/python3.11/site-packages/clwpos/__pycache__/ |
�
P��rCX�� �L � d Z ddlmZ ddlmZ i Zdaed� � � Zd� Zd� Z dS ) aO
This is a simple wrapper around lru_cache which allows
us to enable caching only within some scope defined by contextmanager
It makes it easier to cache some functions e.g. only inside wpos-user get
scope and still be able to get fresh data in wpos-user enable
where cached commands might return different results because of outside
� )�contextmanager)� lru_cacheFc # � K � t rt d� � � da dV � t � � da dS # t � � da w xY w)zK
This context manager sets global marker
which enables caching
znested scopes are not supportedTNF)�CACHING_ENABLED�RuntimeError�_clear_cache� � �py/clwpos/scoped_cache.py�enable_cachingr sa � � � � � >��<�=�=�=� ���
������������� ���������s �2 �Ac �f � t � � � D ]} | � � � �dS )z1
Clear cache of all registered functions
N)�_CACHED_FUNCTIONS�values�cache_clear)�funcs r r r "