Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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)
)