관리-도구
편집 파일: config_watcher.cpython-311.opt-1.pyc
� IMg� � � � d dl Z d dlmZ d dlmZ d dlmZmZmZ d dl m Z mZ ej dd� � Z G d� d ee� � ZdS ) � N)�config)�MessageType)�MessageSink� MessageSource�expect)�recurring_check�Scope�READ_CONFIG_POLLING_INTERVAL� c � � e Zd ZdZej Zd� Zd� Z e e j � � d� � � Zd� Z d� Z ee� � d� � � ZdS ) � ConfigWatcherz�Send ConfigUpdate message on [root's] config update. The config update is detected by polling config file's modification time. c �` � t j � � | _ d| _ d | _ d | _ d S )Nr )r � ConfigFile�_config�_last_notify_time�_sink�_task)�selfs �[/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/plugins/config_watcher.py�__init__zConfigWatcher.__init__ s, � ��(�*�*���!"����� ��� � � � c � � K � dS )zplugins.MessageSink methodN� )r �loops r �create_sinkzConfigWatcher.create_sink s � � � � � r c � �$ K � |d | _ d S )N� timestamp)r �r �messages r �on_config_update_messagez&ConfigWatcher.on_config_update_message! s � � � � ")��!5����r c � �p K � || _ |� | � � � � � | _ d S �N)r �create_task� _check_configr )r r �sinks r � create_sourcezConfigWatcher.create_source'