
    (ph                     D    S SK r S SKJr  S SKJr  SSKJr   " S S5      rg)    N)gettext_lazy)logger   )TimeoutExceptionc                   4    \ rS rSrS\4S jrS rS rS rSr	g)	TimeoutHandler
   timeoutc                     Xl         g )N_timeout)selfr
   s     C/var/www/html/venv/lib/python3.13/site-packages/django_q/timeout.py__init__TimeoutHandler.__init__   s        c                 4    [        SU R                   S35      e)Nz%Task exceeded maximum timeout value (z	 seconds))r   r   )r   signumframes      r   raise_timeout_exception&TimeoutHandler.raise_timeout_exception   s    3DMM?)L
 	
r   c                 0   U R                   S:X  a  g  [        R                  " [        R                  U R                  5        [        R                  " U R                   5        g ! [
        [        4 a"    [        R                  " [        S5      5         g f = f)N*SIGALARM is not available on your platform)
r   signalSIGALRMr   alarm
ValueErrorAttributeErrorr   debug_)r   s    r   	__enter__TimeoutHandler.__enter__   sl    ==B	JMM&..$*F*FGLL'
 	J LLGHI		Js   AA# #/BBc                 &   U R                   S:X  a  g   [        R                  " S5        [        R                  " [        R                  [        R                  5        g ! [
        [        4 a"    [        R                  " [        S5      5         g f = f)Nr   r   r   )
r   r   r   r   SIG_DFLr   r   r   r    r!   )r   exc_type	exc_value	tracebacks       r   __exit__TimeoutHandler.__exit__    sh    ==BS	JLLOMM&..&..9
 	J LLGHI		Js   A	A /BBr   N)
__name__
__module____qualname____firstlineno__intr   r   r"   r)   __static_attributes__ r   r   r   r   
   s       

JJr   r   )	r   django.utils.translationr   r!   django_q.confr   
exceptionsr   r   r1   r   r   <module>r5      s     6   (!J !Jr   