Skip to content

Conversation

@douglasfarinelli
Copy link

Description

Hi guys.

This patch correctly cast the from_url method for the parameters:

  • max_connections
  • max_idle_time
  • idle_check_interval
  • reader_read_size

When assembling a connection string with these parameters, it is not cast before passing it to the ConnectionPool class. Example:

import aredis

aredis.StrictRedis.from_url('redis://localhost:6379?max_connections=100&max_idle_time=5 ')

Out:

~/Documents/Projetos/crm/.venv/lib/python3.9/site-packages/aredis/pool.py in __init__(self, connection_class, max_connections, max_idle_time, idle_check_interval, **connection_kwargs)
    164         max_connections = max_connections or 2 ** 31
    165         if not isinstance(max_connections, int) or max_connections < 0:
--> 166             raise ValueError('"max_connections" must be a positive integer')
    167 
    168         self.connection_class = connection_class

ValueError: "max_connections" must be a positive integer

alisaifee added a commit to alisaifee/coredis that referenced this pull request Jan 17, 2022
- max_connections
- max_idle_time
- idle_check_interval
- reader_read_size

Derived from NoneGG/aredis#201
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.

1 participant