diff options
| author | Roman Haritonov <reclosedev@gmail.com> | 2012-05-02 12:25:50 +0400 |
|---|---|---|
| committer | Roman Haritonov <reclosedev@gmail.com> | 2012-05-02 12:25:50 +0400 |
| commit | 0e48c950f20e1f5eaae4a11f72e15930fac3eb0e (patch) | |
| tree | ad4fa6ecd2627a5a13f739213a9f216baee430e5 /requests_cache/backends/sqlite.py | |
| parent | 40d6e86836943a8723300efb6e1255dfdd344698 (diff) | |
| download | requests-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.py | 6 |
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) |
