(self, resource, lock_identifier=None)
return successful_list[0]
Tries to get the lock from all the redis instances

        :param resource: The resource string name to fetch
        :param lock_identifier: The id of the lock. A unique string
        :return float: The TTL of that lock reported by redis
        :raises: LockRuntimeError or LockAcquiringError or LockError if the lock has not
            been set to at least (N/2 + 1) instances
Tries to get the lock from all the redis instances
Tries to get the lock from all the redis instances
async def get_lock_ttl(self, resource, lock_identifier=None):
        """
        Tries to get the lock from all the redis instances

        :param resource: The resource string name to fetch
        :param lock_identifier: The id of the lock. A unique string
        :return float: The TTL of that lock reported by redis
        :raises: LockRuntimeError or LockAcquiringError or LockError if the lock has not
            been set to at least (N/2 + 1) instances
        """
        start_time = time.monotonic()
        successes = await asyncio.gather(*[
            i.get_lock_ttl(resource, lock_identifier) for
            i in self.instances
        ], return_exceptions=True)
        successful_list = [s for s in successes if not isinstance(s, Exception)]
        # should check if all the value are approx. the same with math.isclose...
        locked = len(successful_list) >= int(len(self.instances) / 2) + 1
        success = all_equal(successful_list) and locked
        elapsed_time = time.monotonic() - start_time

        self.log.debug('Lock "%s" is set on %d/%d instances in %s seconds',
                       resource, len(successful_list), len(self.instances), elapsed_time)

        if not success:
            raise_error(successes, 'Could not fetch the TTL for lock "%s"' % resource)

        return successful_list[0]
async def get_lock_ttl ( self , resource , lock_identifier = None ) : start_time = time . monotonic ( ) successes = await asyncio . gather ( * [ i . get_lock_ttl ( resource , lock_identifier ) for i in self . instances ] , return_exceptions = True ) successful_list = [ s for s in successes if not isinstance ( s , Exception ) ] # should check if all the value are approx. the same with math.isclose... locked = len ( successful_list ) >= int ( len ( self . instances ) / 2 ) + 1 success = all_equal ( successful_list ) and locked elapsed_time = time . monotonic ( ) - start_time self . log . debug ( 'Lock "%s" is set on %d/%d instances in %s seconds' , resource , len ( successful_list ) , len ( self . instances ) , elapsed_time ) if not success : raise_error ( successes , 'Could not fetch the TTL for lock "%s"' % resource ) return successful_list [ 0 ]