
    Ջg                     d    d Z ddlZddlmZ ddlmZ  ej                  e      Z	 G d dee      Zy)z
    flask_caching.backends.simple
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    The simple cache backend.

    :copyright: (c) 2018 by Peter Justin.
    :copyright: (c) 2010 by Thadeus Burgess.
    :license: BSD, see LICENSE for more details.
    N)SimpleCache)	BaseCachec                   (    e Zd ZdZddZed        Zy)r   a  Simple memory cache for single process environments. This class exists
    mainly for the development server and is not 100% thread safe.  It tries
    to use as many atomic operations as possible and no locks for simplicity
    but it could happen under heavy load that keys are added multiple times.

    :param threshold: the maximum number of items the cache stores before
                      it starts deleting some.
    :param default_timeout: the default timeout that is used if no timeout is
                            specified on :meth:`~BaseCache.set`. A timeout of
                            0 indicates that the cache never expires.
    :param ignore_errors: If set to ``True`` the :meth:`~BaseCache.delete_many`
                          method will ignore any errors that occurred during
                          the deletion process. However, if it is set to
                          ``False`` it will stop on the first error. Defaults
                          to ``False``.
    c                 p    t        j                  | |       t        j                  | ||       || _        y )N)default_timeout)	thresholdr   )r   __init__CachelibSimpleCacheignore_errors)selfr   r   r   s       U/var/www/html/venv/lib/python3.12/site-packages/flask_caching/backends/simplecache.pyr	   zSimpleCache.__init__(   s1    4A$$I	
 +    c                 V    |j                  t        |d   |d                 | |i |S )NCACHE_THRESHOLDCACHE_IGNORE_ERRORS)r   r   )updatedict)clsappconfigargskwargss        r   factoryzSimpleCache.factory0   s:     !23$%:;	
 D#F##r   N)i  i,  F)__name__
__module____qualname____doc__r	   classmethodr    r   r   r   r      s     "+ $ $r   r   )
r   loggingcachelibr   r
   flask_caching.backends.baser   	getLoggerr   loggerr   r   r   <module>r%      s8   	  7 1 
		8	$"$)0 "$r   