def re_acquire_lock(self, ltime=5):
        '''Re-acquire the lock.

        You must already own the lock; this is best called from
        within a :meth:`lock` block.

        :param int ltime: maximum time (in seconds) to own lock
        :return: the session lock identifier
        :raise rejester.exceptions.EnvironmentError:
          if we didn't already own the lock

        '''
        conn = redis.Redis(connection_pool=self.pool)
        script = conn.register_script('''
        if redis.call("get", KEYS[1]) == ARGV[1]
        then
          return redis.call("expire", KEYS[1], ARGV[2])
        else
          return -1
        end
        ''')
        ret = script(keys=[self._lock_name],
                     args=[self._session_lock_identifier, ltime])
        if ret != 1:
            raise EnvironmentError('failed to re-acquire lock')

        # logger.debug('re-acquired lock %s', self._lock_name)
        return self._session_lock_identifier
def re_acquire_lock ( self , ltime = 5 ) : conn = redis . Redis ( connection_pool = self . pool ) script = conn . register_script ( '''
        if redis.call("get", KEYS[1]) == ARGV[1]
        then
          return redis.call("expire", KEYS[1], ARGV[2])
        else
          return -1
        end
        ''' ) ret = script ( keys = [ self . _lock_name ] , args = [ self . _session_lock_identifier , ltime ] ) if ret != 1 : raise EnvironmentError ( 'failed to re-acquire lock' ) return self . _session_lock_identifier
Re-acquire the lock.

        You must already own the lock; this is best called from
        within a :meth:`lock` block.

        :param int ltime: maximum time (in seconds) to own lock
        :return: the session lock identifier
        :raise rejester.exceptions.EnvironmentError:
          if we didn't already own the lock