Do not attach limiter without any limiter args
This commit is contained in:
parent
54429e79b5
commit
b9cef7ec63
|
@ -39,6 +39,7 @@ except ImportError:
|
||||||
'Library requests_ratelimiter could not be loaded. Automatic ratelimit configuration will not be used.',
|
'Library requests_ratelimiter could not be loaded. Automatic ratelimit configuration will not be used.',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = ['initialize_session', 'setup_limiter', '__version__']
|
||||||
|
|
||||||
CACHE_PATH_FROM_HOME = '.local/share/usagi-keiretsu/fin_data/http_cache'
|
CACHE_PATH_FROM_HOME = '.local/share/usagi-keiretsu/fin_data/http_cache'
|
||||||
|
|
||||||
|
@ -82,7 +83,7 @@ def setup_limiter(
|
||||||
|
|
||||||
Will always return the given session itself.
|
Will always return the given session itself.
|
||||||
"""
|
"""
|
||||||
if requests_ratelimiter and limiter_args:
|
if requests_ratelimiter and len(limiter_args) > 0:
|
||||||
session.mount(url_prefix, requests_ratelimiter.LimiterAdapter(**limiter_args))
|
session.mount(url_prefix, requests_ratelimiter.LimiterAdapter(**limiter_args))
|
||||||
if requests_cache and expire_after:
|
if requests_cache and expire_after:
|
||||||
if settings := getattr(session, 'settings', None):
|
if settings := getattr(session, 'settings', None):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user