Skip to content

Commit

Permalink
Increase Redis max connections and add retry on error
Browse files Browse the repository at this point in the history
  • Loading branch information
mhdzumair committed Nov 30, 2024
1 parent 345700a commit 8baceb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion db/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Settings(BaseSettings):
mongo_uri: str
db_max_connections: int = 50
redis_url: str = "redis://redis-service:6379"
redis_max_connections: int = 50
redis_max_connections: int = 100

# External Service URLs
scraper_proxy_url: str | None = None
Expand Down
1 change: 1 addition & 0 deletions db/redis_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"health_check_interval": 30, # Health check every 30 seconds
"retry_on_timeout": True,
"decode_responses": False, # Automatically decode responses to Python strings
"retry_on_error": [redis.exceptions.ConnectionError], # Retry on connection errors
}

# Create sync client with connection pooling
Expand Down

0 comments on commit 8baceb7

Please sign in to comment.