old_contents: """
  This module is a wrapper for flask_caching. It configures it and rename
  the memoize function. The aim with that cache is to minimize the requests
  made on the target database.
  """
  import redis
  
  from functools import wraps
  from flask_caching import Cache
  from zou.app import config
  
  
  cache = None
  
  try:
      redis_cache = redis.StrictRedis(
          host=config.KEY_VALUE_STORE["host"],
          port=config.KEY_VALUE_STORE["port"],
          db=config.MEMOIZE_DB_INDEX,
          decode_responses=True
      )
      redis_cache.get("test")
      cache = Cache(config={
          "CACHE_TYPE": "redis",
          "CACHE_REDIS_HOST": config.KEY_VALUE_STORE["host"],
          "CACHE_REDIS_PORT": config.KEY_VALUE_STORE["port"],
          "CACHE_REDIS_DB": config.MEMOIZE_DB_INDEX
      })
  
  # This is needed to run tests which. This way they do not require a Redis
  # instance to work properly
  except redis.ConnectionError:
      from flask import current_app
      current_app.logger.error("Redis cache configuration failed.")
  
      cache = Cache(config={
          "CACHE_TYPE": "simple"
      })
  
  memoize_function = cache.memoize
  
  
  def memoize_function(function, timeout=120):
      function = cache.memoize(function, timeout)
  
      @wraps(function)
      def wrapper(*args, **kwargs):
          result = function(*args, **kwargs)
          if result is None:
              cache.delete_memoized(function)
              result = function(*args, **kwargs)
          return result
  
      return wrapper
  
  
  def clear():
      cache.clear()
  
new_contents: """
  This module is a wrapper for flask_caching. It configures it and rename
  the memoize function. The aim with that cache is to minimize the requests
  made on the target database.
  """
  import redis
  
  from functools import wraps
  from flask_caching import Cache
  from zou.app import config
  
  
  cache = None
  
  try:
      redis_cache = redis.StrictRedis(
          host=config.KEY_VALUE_STORE["host"],
          port=config.KEY_VALUE_STORE["port"],
          db=config.MEMOIZE_DB_INDEX,
          decode_responses=True
      )
      redis_cache.get("test")
      cache = Cache(config={
          "CACHE_TYPE": "redis",
          "CACHE_REDIS_HOST": config.KEY_VALUE_STORE["host"],
          "CACHE_REDIS_PORT": config.KEY_VALUE_STORE["port"],
          "CACHE_REDIS_DB": config.MEMOIZE_DB_INDEX
      })
  
  # This is needed to run tests which. This way they do not require a Redis
  # instance to work properly
  except redis.ConnectionError:
      cache = Cache(config={
          "CACHE_TYPE": "simple"
      })
  
  memoize_function = cache.memoize
  
  
  def memoize_function(function, timeout=120):
      function = cache.memoize(function, timeout)
  
      @wraps(function)
      def wrapper(*args, **kwargs):
          result = function(*args, **kwargs)
          if result is None:
              cache.delete_memoized(function)
              result = function(*args, **kwargs)
          return result
  
      return wrapper
  
  
  def clear():
      cache.clear()
  
subject: Remove cache redis configuration error message