HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/clwpos/__pycache__/cron.cpython-311.opt-1.pyc
�

)|�q����ddlmZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZdddd	�Z
d
ddd
�ZddiZeeeeiZddee
fd�Zdefd�Zd�ZdS)�)�absolute_importN)�iglob)�Iterable)�Feature�OBJECT_CACHE_FEATURE�CDN_FEATUREz/usr/share/cloudlinuxz/etc/cron.d/clwpos_req_cronz./etc/cron.d/clwpos_collect_information_cron.py)�CLSHARE�WPOS_REQ_CRON_FILE�CLWPOS_COLLECT_INFORMATION_CRONz,/etc/cron.d/clwpos_redis_extension_installerz/etc/cron.d/clwpos_cleaner_cronz/etc/cron.d/clwpos_billing_cron)� CLWPOS_REDIS_EXTENSION_INSTALLER�CLWPOS_CLEANER_CRON�CLWPOS_BILLING_CRONrF�featuresc��t|��}|r
tj}ntj}|st	jd��dSt���}|D]I}t�	|��}|��t	jd|��|�
|���J|dgtjtj|���dS)z�
    This script installs cron files based on the features
    that are currently enabled.

    Please note that already installed cron files will not be removed if
    new list has missing feature against previous one.
    z9There are no features active, skip installing cron files.Nz+Feature %s is active, installing cron filesz)/usr/share/cloudlinux/add_clwpos_crons.sh)�stdout�stderr�env)�tuple�
subprocess�run�Popen�logging�info�_DEFAULT_SCRIPT_ENV�copy�_CRON_ENV_BY_FEATURE�get�update�DEVNULL)r�wait_child_process�	exec_func�
env_params�feature�feature_envs      �py/clwpos/cron.py�install_cron_filesr&&s����X���H��%��N�	�	��$�	�����P�Q�Q�Q���$�)�)�+�+�J��'�'��*�.�.�w�7�7�������B�G�L�L�L����+�&�&�&�&�
�I�	4�5��!��!��	�������prefixc�b�d}t|�d|�d���D]}tj|���dS)z*Remove all cron files starting from prefixz/etc/cron.d�/�*N)r�os�unlink)r(�crondir�_fs   r%�clean_cronsr0IsH���G��w�*�*��*�*�*�+�+����
�	�"�
�
�
�
��r'c�&�td���dS)zRemove all WPOS cron files�clwpos_)r(N)r0�r'r%�clean_clwpos_cronsr4Ps���y�!�!�!�!�!�!r')F)�
__future__rr,rr�globr�typingr�clwpos.optimization_featuresrrrr�_OBJECT_CACHING_ENV�_CDN_ENVrr&�strr0r4r3r'r%�<module>r<s:��&�&�&�&�&�&�	�	�	�	�������������������������������'�7�'W����)W�<�<�����<���
�-����� � ��'�!2� � � � �F������"�"�"�"�"r'