o
    ýòTi²  ã                   @   sR   d dl Z d dlmZ ze  ¡ ZW n ey   dZY nw G dd„ deƒZeƒ ZdS )é    N)Úsettingsé   c                   @   s|   e Zd ZdZedd„ ƒZedd„ ƒZedd„ ƒZedd	„ ƒZed
d„ ƒZ	edd„ ƒZ
edd„ ƒZedd„ ƒZedd„ ƒZdS )ÚAppSettingsz
    c                 C   ó   t tddƒS )ú0Control how many times a task will be attempted.ÚMAX_ATTEMPTSé   ©Úgetattrr   ©Úself© r   úX/var/www/html/evchargy.com/venv/lib/python3.10/site-packages/background_task/settings.pyr      ó   zAppSettings.MAX_ATTEMPTSc                 C   ó   | j S )r   )r   r   r   r   r   ÚBACKGROUND_TASK_MAX_ATTEMPTS   ó   z(AppSettings.BACKGROUND_TASK_MAX_ATTEMPTSc                 C   r   )úSMaximum possible task run time, after which tasks will be unlocked and tried again.ÚMAX_RUN_TIMEi  r	   r   r   r   r   r      r   zAppSettings.MAX_RUN_TIMEc                 C   r   )r   )r   r   r   r   r   ÚBACKGROUND_TASK_MAX_RUN_TIME   r   z(AppSettings.BACKGROUND_TASK_MAX_RUN_TIMEc                 C   r   )úBackoff multiplier for retries.ÚBACKOFF_MULTIPLIERé   r	   r   r   r   r   r   $   r   zAppSettings.BACKOFF_MULTIPLIERc                 C   r   )r   )r   r   r   r   r   Ú"BACKGROUND_TASK_BACKOFF_MULTIPLIER)   r   z.AppSettings.BACKGROUND_TASK_BACKOFF_MULTIPLIERc                 C   r   )z7Control if tasks will run asynchronous in a ThreadPool.ÚBACKGROUND_TASK_RUN_ASYNCFr	   r   r   r   r   r   .   r   z%AppSettings.BACKGROUND_TASK_RUN_ASYNCc                 C   s   t tdtƒS )z%Specify number of concurrent threads.ÚBACKGROUND_TASK_ASYNC_THREADS)r
   r   Ú	cpu_countr   r   r   r   r   3   r   z)AppSettings.BACKGROUND_TASK_ASYNC_THREADSc                 C   s$   t tddƒ}|dkrd}|S d}|S )uF  
        Control the ordering of tasks in the queue.
        Choose either `DESC` or `ASC`.

        https://en.m.wikipedia.org/wiki/Nice_(Unix)
        A niceness of âˆ’20 is the highest priority and 19 is the lowest priority. The default niceness for processes is inherited from its parent process and is usually 0.
        Ú!BACKGROUND_TASK_PRIORITY_ORDERINGZDESCZASCÚ ú-r	   )r   ÚorderÚprefixr   r   r   r   8   s   	ÿz-AppSettings.BACKGROUND_TASK_PRIORITY_ORDERINGN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   r   r   r   r   r   r   r   r   r   r   r   r   r      s(    







r   )ÚmultiprocessingZdjango.confr   r   Ú	ExceptionÚobjectr   Zapp_settingsr   r   r   r   Ú<module>   s   ÿ
=