���� JFIF    fdasasfas213sdaf403WebShell
403Webshell
Server IP : 84.32.84.239  /  Your IP : 216.73.216.70
Web Server : LiteSpeed
System : Linux in-mum-web669.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64
User : u479334040 ( 479334040)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/redis/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyc
�
u�fc@sdddlZddlZddlZddlmZmZddlmZde	fd��YZ
dS(i����N(t	LockErrortLockNotOwnedError(tdummytLockcBs�eZdZdZdZdZdZdZdZ	dde
de
d�Zd�Zd�Z
d�Zdddd	�Zd
�Zd�Zd�Zd
�Zd�Zed�Zd�Zd�Zd�ZRS(s�
    A shared, distributed Lock. Using Redis for locking allows the Lock
    to be shared across processes and/or machines.

    It's left to the user to resolve deadlock issues and make sure
    multiple clients play nicely together.
    s�
        local token = redis.call('get', KEYS[1])
        if not token or token ~= ARGV[1] then
            return 0
        end
        redis.call('del', KEYS[1])
        return 1
    s�
        local token = redis.call('get', KEYS[1])
        if not token or token ~= ARGV[1] then
            return 0
        end
        local expiration = redis.call('pttl', KEYS[1])
        if not expiration then
            expiration = 0
        end
        if expiration < 0 then
            return 0
        end

        local newttl = ARGV[2]
        if ARGV[3] == "0" then
            newttl = ARGV[2] + expiration
        end
        redis.call('pexpire', KEYS[1], newttl)
        return 1
    s�
        local token = redis.call('get', KEYS[1])
        if not token or token ~= ARGV[1] then
            return 0
        end
        redis.call('pexpire', KEYS[1], ARGV[2])
        return 1
    g�������?cCs�||_||_||_||_||_||_t|�|_|jrZtj	�nt
�|_	d|j	_|j
�dS(s�

        Create a new Lock instance named ``name`` using the Redis client
        supplied by ``redis``.

        ``timeout`` indicates a maximum life for the lock.
        By default, it will remain locked until release() is called.
        ``timeout`` can be specified as a float or integer, both representing
        the number of seconds to wait.

        ``sleep`` indicates the amount of time to sleep per loop iteration
        when the lock is in blocking mode and another client is currently
        holding the lock.

        ``blocking`` indicates whether calling ``acquire`` should block until
        the lock has been acquired or to fail immediately, causing ``acquire``
        to return False and the lock not being acquired. Defaults to True.
        Note this value can be overridden by passing a ``blocking``
        argument to ``acquire``.

        ``blocking_timeout`` indicates the maximum amount of time in seconds to
        spend trying to acquire the lock. A value of ``None`` indicates
        continue trying forever. ``blocking_timeout`` can be specified as a
        float or integer, both representing the number of seconds to wait.

        ``thread_local`` indicates whether the lock token is placed in
        thread-local storage. By default, the token is placed in thread local
        storage so that a thread only sees its token, not a token set by
        another thread. Consider the following timeline:

            time: 0, thread-1 acquires `my-lock`, with a timeout of 5 seconds.
                     thread-1 sets the token to "abc"
            time: 1, thread-2 blocks trying to acquire `my-lock` using the
                     Lock instance.
            time: 5, thread-1 has not yet completed. redis expires the lock
                     key.
            time: 5, thread-2 acquired `my-lock` now that it's available.
                     thread-2 sets the token to "xyz"
            time: 6, thread-1 finishes its work and calls release(). if the
                     token is *not* stored in thread local storage, then
                     thread-1 would see the token value as "xyz" and would be
                     able to successfully release the thread-2's lock.

        In some use cases it's necessary to disable thread local storage. For
        example, if you have code where one thread acquires a lock and passes
        that lock instance to a worker thread to release later. If thread
        local storage isn't disabled in this case, the worker thread won't see
        the token set by the thread that acquired the lock. Our assumption
        is that these cases aren't common and as such default to using
        thread local storage.
        N(tredistnamettimeouttsleeptblockingtblocking_timeouttbooltthread_localt	threadingtlocalRtNonettokentregister_scripts(tselfRRRRRR	R((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyt__init__Is4						!cCs�|j}|j}|jdkr9|j|j�|_n|jdkr`|j|j�|_n|jdkr�|j|j	�|_ndS(N(
t	__class__Rtlua_releaseRtregister_scripttLUA_RELEASE_SCRIPTt
lua_extendtLUA_EXTEND_SCRIPTt
lua_reacquiretLUA_REACQUIRE_SCRIPT(Rtclstclient((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyR�s		cCs&|jdt�r|Std��dS(NRs0Unable to acquire lock within the time specified(tacquiretTrueR(R((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyt	__enter__�scCs|j�dS(N(trelease(Rtexc_typet	exc_valuet	traceback((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyt__exit__�scCs|j}|dkr-tj�jj�}n!|jjj�}|j|�}|dkrf|j	}n|dkr~|j
}nd}|dk	r�tj�|}nxlt
r|j|�r�||j_t
S|s�tStj�|}|dk	r||krtStj|�q�WdS(ss
        Use Redis to hold a shared, distributed lock named ``name``.
        Returns True once the lock is acquired.

        If ``blocking`` is False, always return immediately. If the lock
        was acquired, return True, otherwise return False.

        ``blocking_timeout`` specifies the maximum number of seconds to
        wait trying to acquire the lock.

        ``token`` specifies the token value to be used. If provided, token
        must be a bytes object or a string that can be encoded to a bytes
        object with the default encoding. If a token isn't specified, a UUID
        will be generated.
        N(RRtuuidtuuid1thextencodeRtconnection_pooltget_encoderRR	tmod_timettimeRt
do_acquireR
RtFalse(RRR	RRtencodertstop_trying_attnext_try_at((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyR�s,		cCsQ|jrt|jd�}nd}|jj|j|dtd|�rMtStS(Ni�tnxtpx(RtintRRtsetRRR.(RRR((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyR-�s	$cCs|jj|j�dk	S(sU
        Returns True if this key is locked by any process, otherwise False.
        N(RtgetRR(R((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pytlocked�scCsq|jj|j�}|rOt|t�rO|jjj�}|j|�}n|jj	dk	op||jj	kS(sS
        Returns True if this key is locked by this lock, otherwise False.
        N(RR6Rt
isinstancetbytesR)R*R(R
RR(Rtstored_tokenR/((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pytowned�scCsD|jj}|dkr'td��nd|j_|j|�dS(s"Releases the already acquired locksCannot release an unlocked lockN(R
RRRt
do_release(Rtexpected_token((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyR �s
cCsCt|jd|jgd|gd|j��s?td��ndS(NtkeystargsRs,Cannot release a lock that's no longer owned(R
RRRR(RR=((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyR<�s	cCsO|jjdkr!td��n|jdkr?td��n|j||�S(sh
        Adds more time to an already acquired lock.

        ``additional_time`` can be specified as an integer or a float, both
        representing the number of seconds to add.

        ``replace_ttl`` if False (the default), add `additional_time` to
        the lock's existing ttl. If True, replace the lock's ttl with
        `additional_time`.
        sCannot extend an unlocked locks$Cannot extend a lock with no timeoutN(R
RRRRt	do_extend(Rtadditional_timetreplace_ttl((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pytextend�s
cCskt|d�}t|jd|jgd|jj||r@dpCdgd|j��sgtd��ntS(Ni�R>R?t1t0Rs+Cannot extend a lock that's no longer owned(	R4R
RRR
RRRR(RRARB((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyR@s		cCsI|jjdkr!td��n|jdkr?td��n|j�S(sS
        Resets a TTL of an already acquired lock back to a timeout value.
        s!Cannot reacquire an unlocked locks'Cannot reacquire a lock with no timeoutN(R
RRRRtdo_reacquire(R((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyt	reacquires
cCs_t|jd�}t|jd|jgd|jj|gd|j��s[td��nt	S(Ni�R>R?Rs.Cannot reacquire a lock that's no longer owned(
R4RR
RRR
RRRR(RR((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyRFsN(t__name__t
__module__t__doc__RRRRRRRRRRRR$RR-R7R;R R<R.RCR@RGRF(((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyRs,
>			(	
		
				
(RR,R+R%tredis.exceptionsRRtredis.utilsRtobjectR(((s;/opt/alt/python27/lib/python2.7/site-packages/redis/lock.pyt<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit