def cleanup(self):
        """
        Removes expired nodes/replicas from the ring.
        """
        now = time.time()
        expired = now - NODE_TIMEOUT
        if self.conn.zremrangebyscore(self.key, 0, expired):
            self._notify()