From cfd5c391f546e5e9cfaeb5a0339750f9a790325a Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Tue, 27 Apr 2021 16:26:46 -0500 Subject: Add BaseCache.keys() and values() methods * Update `BaseCache.urls` to return a generator instead of the whole list at once (which may use too much memory for particularly large caches) * Update `BaseCache.urls` to just skip invalid responses instead of deleting them --- requests_cache/backends/sqlite.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'requests_cache/backends/sqlite.py') diff --git a/requests_cache/backends/sqlite.py b/requests_cache/backends/sqlite.py index 29ac083..5ad100a 100644 --- a/requests_cache/backends/sqlite.py +++ b/requests_cache/backends/sqlite.py @@ -27,7 +27,11 @@ class DbCache(BaseCache): """ def __init__( - self, db_path: Union[Path, str] = 'http_cache', use_temp: bool = False, fast_save: bool = False, **kwargs + self, + db_path: Union[Path, str] = 'http_cache', + use_temp: bool = False, + fast_save: bool = False, + **kwargs, ): super().__init__(**kwargs) self.responses = DbPickleDict(db_path, table_name='responses', use_temp=use_temp, fast_save=fast_save, **kwargs) -- cgit v1.2.1