MOON
Server: Apache
System: Linux vps.erhabenn.com.br 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User: sonne (1011)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //usr/lib/python2.7/site-packages/azurelinuxagent/ga/periodic_operation.pyo
�
d�bc@sRddlZddlZddlmZddlmZdefd��YZdS(i����N(tlogger(tustrtPeriodicOperationcBsSeZdZejdd�Zd�Zd�Zd�Zd�Z	e
d��ZRS(s�
    Instances of PeriodicOperation are tasks that are executed only after the given
    time period has elapsed.

    NOTE: the run() method catches any exceptions raised by the operation and logs them as warnings.
    tminutesi<cCsd|jj|_t|tj�r'|ntjd|�|_tjj�|_d|_
d|_dS(Ntseconds(t	__class__t__name__t_namet
isinstancetdatetimet	timedeltat_periodtutcnowt_next_run_timetNonet
_last_warningt_last_warning_time(tselftperiod((sI/usr/lib/python2.7/site-packages/azurelinuxagent/ga/periodic_operation.pyt__init__$s
-	cCs�y]|jtjj�kr\z!tjd|j�|j�Wdtjj�|j|_XnWn�tk
r�}dj	|jt
|��}||jks�|jdks�tjj�|j|jkr�tj|�tjj�|_||_q�nXdS(NsExecuting {0}...sKError in {0}: {1} --- [NOTE: Will not log the same error for the next hour](R
R	RRtverboseRt
_operationRt	ExceptiontformatRRRRt_LOG_WARNING_PERIODtwarn(Rtetwarning((sI/usr/lib/python2.7/site-packages/azurelinuxagent/ga/periodic_operation.pytrun+s!=
cCs|jS(N(R
(R((sI/usr/lib/python2.7/site-packages/azurelinuxagent/ga/periodic_operation.pyt
next_run_time:scCs
t��dS(sn
        Derived classes must override this with the definition of the operation they need to perform
        N(tNotImplementedError(R((sI/usr/lib/python2.7/site-packages/azurelinuxagent/ga/periodic_operation.pyR=scCstg|D]}|j�^q
�}|tjj�}|jdd|jd|jd}|dkr{tj|�ndS(	s�
        Takes a list of operations, finds the operation that should be executed next (that with the closest next_run_time)
        and sleeps until it is time to execute that operation.
        iig$@iiNg��.Ag��.A(	tminRR	RtdaysRtmicrosecondsttimetsleep(t
operationstoptnext_operation_timetsleep_timedeltat
sleep_seconds((sI/usr/lib/python2.7/site-packages/azurelinuxagent/ga/periodic_operation.pytsleep_until_next_operationCs
%'(Rt
__module__t__doc__R	R
RRRRRtstaticmethodR)(((sI/usr/lib/python2.7/site-packages/azurelinuxagent/ga/periodic_operation.pyRs				(R	R"tazurelinuxagent.commonRtazurelinuxagent.common.futureRtobjectR(((sI/usr/lib/python2.7/site-packages/azurelinuxagent/ga/periodic_operation.pyt<module>s