From df90cd5afa600a398fbd43a5130aa1c2748e99a3 Mon Sep 17 00:00:00 2001 From: Joakim Soderlund Date: Wed, 22 Aug 2018 18:49:15 +0200 Subject: [PATCH] Fix high memory usage from eager caching --- fimfarchive/fetchers/fimfiction2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fimfarchive/fetchers/fimfiction2.py b/fimfarchive/fetchers/fimfiction2.py index 5c4b11c..84c88d9 100644 --- a/fimfarchive/fetchers/fimfiction2.py +++ b/fimfarchive/fetchers/fimfiction2.py @@ -149,7 +149,7 @@ class ApiClient: Args: token: Fimfiction authorization bearer. """ - self.session = self.create_session(token) + self.token = token def create_session(self, token: str) -> Session: """ @@ -201,8 +201,9 @@ class ApiClient: A jsonapi response document. """ query = self.create_filter(params) + session = self.create_session(self.token) - return self.session.get(path, query) + return session.get(path, query) class Requester(ABC):