Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dicklesworthstone committed May 21, 2024
1 parent ed6029e commit b7010ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions misc_utility_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pytest
python-decouple
python-multipart
pytz
redis
sqlalchemy
textract-py3
uvicorn
Expand Down

0 comments on commit b7010ca

Please sign in to comment.