(self)
Release a lock at the Lock's path.
        Return True if success.  Raise UserWarning otherwise, possibly due to:
            - did not release a lock
            - lock already released
            - lock does not exist (perhaps it was never acquired)
Release a lock at the Lock's path.
        Return True if success.  Raise UserWarning otherwise, possibly due to:
            - did not release a lock
            - lock already released
            - lock does not exist (perhaps it was never acquired)
Release a lock at the Lock s path . Return True if success . Raise UserWarning otherwise possibly due to : - did not release a lock - lock already released - lock does not exist ( perhaps it was never acquired )
def release(self):
        """
        Release a lock at the Lock's path.
        Return True if success.  Raise UserWarning otherwise, possibly due to:
            - did not release a lock
            - lock already released
            - lock does not exist (perhaps it was never acquired)
        """
        if self.LOCKS.get(self._path) != self._client_id:
            raise UserWarning("You must acquire lock before releasing it")
        self.LOCKS.pop(self._path)

        try:
            rv = raw_client().evalsha(
                self._SHAS['l_unlock'],
                len(self.SCRIPTS['l_unlock']['keys']),
                self._path, self._client_id)
            assert rv == 1
        except AssertionError:
            raise UserWarning("Lock did not exist on Redis server")
        except Exception as err:
            msg = "Could not release lock.  Got error: %s" % err
            log.error(msg, extra=dict(lock_path=self._path))
            raise UserWarning(msg)
def release ( self ) : if self . LOCKS . get ( self . _path ) != self . _client_id : raise UserWarning ( "You must acquire lock before releasing it" ) self . LOCKS . pop ( self . _path ) try : rv = raw_client ( ) . evalsha ( self . _SHAS [ 'l_unlock' ] , len ( self . SCRIPTS [ 'l_unlock' ] [ 'keys' ] ) , self . _path , self . _client_id ) assert rv == 1 except AssertionError : raise UserWarning ( "Lock did not exist on Redis server" ) except Exception as err : msg = "Could not release lock.  Got error: %s" % err log . error ( msg , extra = dict ( lock_path = self . _path ) ) raise UserWarning ( msg )