pub async fn create_redis_connection(
con_name: &str,
config: DatabaseConfig,
) -> Result<ConnectionManager>
Expand description
Creates a new Redis connection manager based on the provided database config
and connection name.
§Errors
Returns an error if:
- Constructing the Redis client fails.
- Establishing or configuring the connection manager fails.
In case of reconnection issues, the connection will retry reconnection
number_of_retries
times, with an exponentially increasing delay, calculated as
rand(0 .. factor * (exponent_base ^ current-try))
.
The new connection will time out operations after response_timeout
has passed.
Each connection attempt to the server will time out after connection_timeout
.