Skip to content

Commit

Permalink
Merge pull request #619 from JWCook/fix-patch-memory
Browse files Browse the repository at this point in the history
(0.9) Initialize backend with install_cache() prior to patching requests.Session
  • Loading branch information
JWCook committed Apr 29, 2022
2 parents 39fb312 + dd3d162 commit 304f875
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion requests_cache/patcher.py
Expand Up @@ -13,7 +13,7 @@

import requests

from .backends import BackendSpecifier, BaseCache
from .backends import BackendSpecifier, BaseCache, init_backend
from .cache_control import ExpirationTime
from .session import CachedSession, OriginalSession

Expand Down Expand Up @@ -45,6 +45,7 @@ def install_cache(
session_factory: Session class to use. It must inherit from either
:py:class:`.CachedSession` or :py:class:`.CacheMixin`
"""
backend = init_backend(cache_name, backend, **kwargs)

class _ConfiguredCachedSession(session_factory): # type: ignore # See mypy issue #5865
def __init__(self):
Expand Down

0 comments on commit 304f875

Please sign in to comment.