From 0e48c950f20e1f5eaae4a11f72e15930fac3eb0e Mon Sep 17 00:00:00 2001 From: Roman Haritonov Date: Wed, 2 May 2012 12:25:50 +0400 Subject: add fast_save option to DbCache backend --- requests_cache/backends/sqlite.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'requests_cache/backends/sqlite.py') 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 ` 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) -- cgit v1.2.1