wo4hddlZddlmZddlmZddlmZmZmZddl m Z m Z ej ddZ Gdd eeZdS) N)config) MessageType) MessageSink MessageSourceexpect)recurring_checkScopeREAD_CONFIG_POLLING_INTERVALceZdZdZejZdZdZe e j dZ dZ dZeedZdS) ConfigWatcherzSend ConfigUpdate message on [root's] config update. The config update is detected by polling config file's modification time. c`tj|_d|_d|_d|_dS)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 KdS)zplugins.MessageSink methodN)rloops r create_sinkzConfigWatcher.create_sinks rc$K|d|_dS)N timestamp)rrmessages ron_config_update_messagez&ConfigWatcher.on_config_update_message!s")!5rcpK||_|||_dSN)r create_task _check_configr)rrsinks r create_sourcezConfigWatcher.create_source's2 %%d&8&8&:&:;; rc|K|j+|jdc}|_||d{Vd|_dSr")rcancelr)rts rshutdownzConfigWatcher.shutdown+sF : ! JMAtz HHJJJGGGGGGG rcKtj|jr[tj|jt j}|j|d{V|d|_dSdS)N)confrr) rany_layer_modified_sincerr ConfigUpdatertimerprocess_messagers rr$zConfigWatcher._check_config2s  *4+A B B :!.\TY[[G*,,W55 5 5 5 5 5 5 5&-[%9D " " " : :rN)__name__ __module__ __qualname____doc__r AVSCOPErrrrr.r r&r*rPOLLING_INTERVALr$rrrr r s HE %%% VK $%%66&%6 <<<_%&& : :'& : : :rr )r/defence360agent.contractsr"defence360agent.contracts.messagesr!defence360agent.contracts.pluginsrrrdefence360agent.utilsrr int_from_envvarr7r rrrr=s ,,,,,,:::::: 98888888)6)*H"MM.:.:.:.:.:K.:.:.:.:.:r