How to use the redislite.client.RedisLiteServerStartError function in redislite

To help you get started, we’ve selected a few redislite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yahoo / redislite / redislite / client.py View on Github external
logger.debug('The binary redis-server failed to start')
            redis_log = os.path.join(self.redis_dir, 'redis.log')
            if os.path.exists(redis_log):
                with open(redis_log) as file_handle:
                    logger.debug(file_handle.read())
            raise RedisLiteException('The binary redis-server failed to start')

        # Wait for Redis to start
        timeout = True
        for i in range(0, self.start_timeout * 10):
            if os.path.exists(self.socket_file):
                timeout = False
                break
            time.sleep(.1)
        if timeout:  # pragma: no cover
            raise RedisLiteServerStartError(
                'The redis-server process failed to start'
            )

        if not os.path.exists(self.socket_file):  # pragma: no cover
            raise RedisLiteException(
                'Redis socket file %s is not present' % self.socket_file
            )

        self._save_setting_registry()
        self.running = True
github yahoo / redislite / redislite / client.py View on Github external
Raises
        ------
        RedisLiteServerStartError - Server start timed out
        """
        timeout = True
        for i in range(0, self.start_timeout * 10):
            try:
                self.ping()
                timeout = False
                break
            except redis.BusyLoadingError:
                pass
            time.sleep(.1)
        if timeout:  # pragma: no cover
            raise RedisLiteServerStartError(
                'The redis-server process failed to start; unreachable after '
                '{0} seconds'.format(self.start_timeout)
            )