o
    ]f                     @   sD   d Z ddlZddlmZ ddlmZ eeZ	G dd deeZdS )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                   @   s&   e Zd ZdZd
ddZedd Zd	S )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``.
      ,  Fc                 C   s(   t j| |d tj| ||d || _d S )N)default_timeout)	thresholdr   )r   __init__CachelibSimpleCacheignore_errors)selfr   r   r
    r   [/home/ubuntu/webapp/venv/lib/python3.10/site-packages/flask_caching/backends/simplecache.pyr   (   s
   
zSimpleCache.__init__c                 C   s(   | t|d |d d | |i |S )NCACHE_THRESHOLDCACHE_IGNORE_ERRORS)r   r
   )updatedict)clsappconfigargskwargsr   r   r   factory0   s   zSimpleCache.factoryN)r   r   F)__name__
__module____qualname____doc__r   classmethodr   r   r   r   r   r      s
    
r   )
r   loggingcachelibr   r	   flask_caching.backends.baser   	getLoggerr   loggerr   r   r   r   <module>   s    
