PK œqhYî¶J‚ßF ßF ) nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/
| Dir : /opt/imunify360/venv/lib64/python3.11/site-packages/defence360agent/files/ |
| Server: Linux cloud.virginhosting.lk 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64 IP: 128.140.68.198 |
| Dir : //opt/imunify360/venv/lib64/python3.11/site-packages/defence360agent/files/hooks.py |
"""Run default hooks for files update and log errors if any."""
from logging import getLogger
from defence360agent.utils import check_run, CheckRunError
logger = getLogger(__name__)
DEFAULT_HOOKS = {}
async def default_hook(files_index_object, is_updated) -> None:
"""Run delivered hooks for files update. Errors are logged up on stack."""
if is_updated:
hook = DEFAULT_HOOKS.get(files_index_object.type)
if hook and hook.exists():
try:
await check_run([hook])
except CheckRunError as e:
logger.error("Error during hook execution: %s", e)