diff --git a/misc_utility_functions.py b/misc_utility_functions.py index 044a18d..e576d43 100644 --- a/misc_utility_functions.py +++ b/misc_utility_functions.py @@ -248,6 +248,11 @@ def tell(self) -> int: return self.file.tell() def configure_redis_optimally(redis_host='localhost', redis_port=6379, maxmemory='1gb'): + try: + subprocess.run(["sudo systemctl start redis-server"], check=True) + except subprocess.CalledProcessError as e: + logger.error(f"Failed to start Redis server: {e}") + raise r = redis.StrictRedis(host=redis_host, port=redis_port, decode_responses=True) def set_config(key, value): response = r.config_set(key, value) diff --git a/requirements.txt b/requirements.txt index 5e926e6..6694be0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,6 +21,7 @@ pytest python-decouple python-multipart pytz +redis sqlalchemy textract-py3 uvicorn