summaryrefslogtreecommitdiff
path: root/requests_cache/backends/sqlite.py
diff options
context:
space:
mode:
authorRoman Haritonov <reclosedev@gmail.com>2012-05-02 12:25:50 +0400
committerRoman Haritonov <reclosedev@gmail.com>2012-05-02 12:25:50 +0400
commit0e48c950f20e1f5eaae4a11f72e15930fac3eb0e (patch)
treead4fa6ecd2627a5a13f739213a9f216baee430e5 /requests_cache/backends/sqlite.py
parent40d6e86836943a8723300efb6e1255dfdd344698 (diff)
downloadrequests-cache-0e48c950f20e1f5eaae4a11f72e15930fac3eb0e.tar.gz
add fast_save option to DbCache backend
Diffstat (limited to 'requests_cache/backends/sqlite.py')
-rw-r--r--requests_cache/backends/sqlite.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/requests_cache/backends/sqlite.py b/requests_cache/backends/sqlite.py
index 83bab79..bc0c8ee 100644
--- a/requests_cache/backends/sqlite.py
+++ b/requests_cache/backends/sqlite.py
@@ -16,11 +16,13 @@ class DbCache(BaseCache):
Reading is fast, saving is a bit slower. It can store big amount of data
with low memory usage.
"""
- def __init__(self, location='cache', **options):
+ def __init__(self, location='cache', fast_save=False, **options):
"""
:param location: database filename prefix (default: ``'cache'``)
+ :param fast_save: Speedup cache saving with possibility of data loss.
+ See :ref:`backends.DbDict <backends_dbdict>` for more info
"""
super(DbCache, self).__init__()
- self.responses = DbPickleDict(location, 'responses')
+ self.responses = DbPickleDict(location, 'responses', fast_save=fast_save)
self.url_map = DbDict(location, 'urls', self.responses)