File manager - Edit - /opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/utils/__pycache__/persistent_mrs_queue.cpython-311.pyc
Back
� ,|_j- � � � d Z ddlmZ ddlZddlmZ ddlmZmZ ddl m Z mZmZm Z mZmZ ddlmZ G d� d � � ZdS ) u This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see <https://www.imunify360.com/legal/eula> � )�annotationsN)�Iterable)�Case�fn)� EXHAUSTED�PENDING� PROCESSING�WORKING_STATUSES�MRSQueueCounter� MRSUploadItem)�SQLITE_LIMIT_VARIABLE_NUMBERc �� � e Zd Zddefd;d �Zd<d�Zd=d�Z d>d?d�Zd@d�Z dAdBd�Z dCdDd�Z dEdFd"�ZdGd#�ZdGd$�Z dHd&�ZdGd'�ZdGd(�ZdGd)�ZdId+�ZdJd-�ZdKd/�ZdId0�ZdLd2�ZdMd4�ZdGd5�Ze dNdOd:�� � ZdS )P�PersistentMRSQueuei�� i�: � storage_limit�int�exhausted_ttl_seconds�float�model�type[MRSUploadItem]c �R � || _ || _ || _ |j j | _ d S �N)�_storage_limit�_exhausted_ttl_seconds�_model�_meta�database�_db)�selfr r r s �_/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/utils/persistent_mrs_queue.py�__init__zPersistentMRSQueue.__init__) s+ � � ,���&;��#�����;�'����� �name�str�delta�return�Nonec �� � |dk rdS t j ||�� � � t j gt j t j |z i�� � � � � dS )z?Increment a persistent counter. Must be called inside atomic().r N)r"