Edit File: update_hooks.cpython-311.opt-1.pyc
� P6h � �D � d dl Z d dlmZ d dlmZ d dlmZ ddlmZ d� Z dS )� N)�instance)�run_in_executor)�GeoCSVReader� )�Countryc � � K � d� }t j � � }t |d� � � � d{V ��}|dk s|rt ||� � � d{V �� dS dS )zK Load countries list (if it is empty) from the csv file on update. c �� � t � � } t j � � � 5 t j | � � � � � d d d � � d S # 1 swxY w Y d S �N)r r �db�atomicr �update_from� countries)�csvs �M/opt/imunify360/venv/lib/python3.11/site-packages/im360/model/update_hooks.py�update_country_db_from_csvz0update_geodb.<locals>.update_country_db_from_csv s� � ��n�n�� �[� � � !� !� 1� 1���� � ���0�0�0� 1� 1� 1� 1� 1� 1� 1� 1� 1� 1� 1� 1���� 1� 1� 1� 1� 1� 1s �'A!�!A%�(A%c �L � t j � � � � � S r )r �select�count� � r �<lambda>zupdate_geodb.<locals>.<lambda> s � �w�~�'�'�-�-�/�/� r Nr )�asyncio�get_event_loopr )�_� is_updatedr �loop�countries_counts r �update_geodbr s� � � � � 1� 1� 1� �!�#�#�D� ,��0�0�� � � � � � � �O� �1������d�$>�?�?�?�?�?�?�?�?�?�?�?� �r ) r �defence360agent.modelr �$defence360agent.model.simplificationr �im360.model.geoip_datar �countryr r r r r �<module>r# st �� ���� *� *� *� *� *� *� @� @� @� @� @� @� /� /� /� /� /� /� � � � � � �@� @� @� @� @r