Skip to content

Commit

Permalink
[3.7] TCPConnector ttl_dns_cache type hint. (#4279). (#4280)
Browse files Browse the repository at this point in the history
(cherry picked from commit 18b9274)

Co-authored-by: Fernanda Guimarães <[email protected]>
  • Loading branch information
asvetlov and haneybarg authored Oct 26, 2019
1 parent 15dc6aa commit e246e1c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES/4270.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changes doc and ttl_dns_cache type from int to Optional[int].
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Eugene Naydenov
Eugene Nikolaiev
Eugene Tolmachev
Evert Lammerts
Felix Yan
Fernanda Guimarães
FichteFoll
Florian Scheffler
Frederik Gladhorn
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ class TCPConnector(BaseConnector):

def __init__(self, *, verify_ssl: bool=True,
fingerprint: Optional[bytes]=None,
use_dns_cache: bool=True, ttl_dns_cache: int=10,
use_dns_cache: bool=True, ttl_dns_cache: Optional[int]=10,
family: int=0,
ssl_context: Optional[SSLContext]=None,
ssl: Union[None, bool, Fingerprint, SSLContext]=None,
Expand Down
2 changes: 1 addition & 1 deletion docs/client_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ TCPConnector
*side effects* also.

:param int ttl_dns_cache: expire after some seconds the DNS entries, ``None``
means cached forever. By default 10 seconds.
means cached forever. By default 10 seconds (optional).

In some environments the IP addresses related to a specific HOST can
change after a specific time. Use this option to keep the DNS cache
Expand Down

0 comments on commit e246e1c

Please sign in to comment.