Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(python): add retry strategy in connection #1975

Merged
merged 3 commits into from Jun 14, 2023
Merged

Conversation

roggervalf
Copy link
Collaborator

@roggervalf roggervalf commented Jun 13, 2023

if isinstance(redisOpts, dict):
host = redisOpts.get("host") or "localhost"
port = redisOpts.get("port") or 6379
db = redisOpts.get("db") or 0
password = redisOpts.get("password") or None

self.conn = redis.Redis(
host=host, port=port, db=db, password=password, decode_responses=True)
host=host, port=port, db=db, password=password, decode_responses=True,
retry=retry, retry_on_error=[BusyLoadingError, ConnectionError, TimeoutError])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the array with the connection errors is used two times I think it could be refactored out.

@roggervalf roggervalf merged commit 7c5ee20 into master Jun 14, 2023
9 of 10 checks passed
@roggervalf roggervalf deleted the redis-python-retry branch June 14, 2023 14:00
github-actions bot pushed a commit that referenced this pull request Jun 16, 2023
## [3.15.7](v3.15.6...v3.15.7) (2023-06-16)

### Bug Fixes

* **python:** add retry strategy in connection ([#1975](#1975)) ([7c5ee20](7c5ee20))
* **worker:** set redis version always in initialization ([#1989](#1989)) fixes [#1988](#1988) ([a1544a8](a1544a8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants