Skip to main content

Build Status Coverage

(aio)REDIS wrapper to deal with cluster redirect exceptions MOVED

Handles exceptions like:

    redis.exceptions.ResponseError: MOVED 4085 10.213.192.152:6379

When Redis returns a MOVED exception, it indicates that the client should repeat its request for the specified host.

This exception can occur in the following situations:

  1. Your Redis configuration is incorrect. In this case, you should fix your Redis settings. redis-redirect cannot help in this scenario.
  2. You are connecting to the wrong host. For instance, if you're using Amazon managed Redis (ElastiCache), Amazon provides a fixed DNS name for the configuration node and an IP address for the work node. The IP address may change in the future. In such cases, you should use the DNS name. redis-redirect cannot help in this scenario.
  3. You're using a multi-node Redis cluster. In this case, you can use redis-redirect to automatically switch between Redis nodes or shards.

redis-redirect handles MOVED exceptions seamlessly and transparently.

Installation

    pip install redis-redirect

Usage

    import redis_redirect

    redis = redis_redirect.Redis(host='my-redis.com', port=6379, db=0)
    redis.set('foo', 'bar')

How it works

redis-redirect transparently handles Redis server redirection exceptions.

When a client sends a request to the Redis server, redis-redirect checks if the server has returned a MOVED exception.

If a MOVED exception is received, redis-redirect updates the Redis server address and resends the request to the new address.

After updating the Redis server address, redis-redirect transparently forwards subsequent requests to the new Redis server address.

Coverage report

Metadata

Release files for redis-redirect 0.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redis-redirect 0.1.10
File Size Uploaded Provenance
redis_redirect-0.1.10.tar.gz 7.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for redis-redirect 0.1.10
File Interpreter ABI Platform
redis_redirect-0.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 14.4 kB

Release files / redis_redirect-0.1.10.tar.gz

Download URL redis_redirect-0.1.10.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
888e1f36edc0376fa739fc090582712a798f5fabbf830f8e1d50e70092174800
BLAKE2b-256 checksum
How to use checksums
eff8353fa97b2c91ee9d56835c23699254fe8430962fc3f901b3bb8e78b41ce3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / redis_redirect-0.1.10-py3-none-any.whl

Download URL redis_redirect-0.1.10-py3-none-any.whl
Size 7.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15862efaae934191ce9ff050d6f3d445577a92e02874590f2069f38492c570d3
BLAKE2b-256 checksum
How to use checksums
6391b690ef092d4f0a76ed5591cc65bc121b523c541ab15b88dcbea3ca041db6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for redis-redirect 0.1.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page