관리-도구
편집 파일: messages_to_send.cpython-311.pyc
� IMg| � �N � d dl mZ d dlmZmZ d dlmZmZ G d� de� � ZdS )� )� namedtuple)� FloatField� BlobField)�instance�Modelc �� � � e Zd ZdZ G d� d� � Z ed�� � Z ed�� � Z e dd� � Z edd �� � Zed � � � Z edd�� � Zed� fd�� � Z� xZS )� MessageToSendzc Storage for messages to be sent to server while connection to server is not available c � � e Zd Zej ZdZdS )�MessageToSend.Meta�messages_to_send_nrN)�__name__� __module__�__qualname__r �db�database�db_table� � �[/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model/messages_to_send.py�Metar s � � � � � ��;��(���r r F)�null�MessageToSendTztimestamp message� c � � | � � � � | j � � � |� � }|S �N)�select�order_by� timestamp�limit)�clsr �olds r � get_oldestzMessageToSend.get_oldest s2 � ��j�j�l�l�#�#�C�M�2�2�8�8��?�?��� r c � � | � � � � | j � |� � � � }|� � � S r )�delete�where�id�in_�execute)r �query�qs r � delete_inzMessageToSend.delete_in s9 � ��J�J�L�L���s�v�z�z�%�0�0�1�1���y�y�{�{�r c �& � | � � � � | j � � � |� � }| � � � � | j � |� � � � }|� � � S r ) r r r r r$ r% r&