diff options
| author | Jordan Cook <jordan.cook@pioneer.com> | 2022-04-18 14:03:18 -0500 |
|---|---|---|
| committer | Jordan Cook <jordan.cook@pioneer.com> | 2022-04-18 14:15:29 -0500 |
| commit | f174ce3d0542d3823b93448e4c4ef6c2cef14179 (patch) | |
| tree | b0f711885c107c3fbc621c8bfd690b9de6a83842 /requests_cache/backends/mongodb.py | |
| parent | 97a6a19035f4a68e7e4689fc0a1cec6e7781c4a4 (diff) | |
| download | requests-cache-f174ce3d0542d3823b93448e4c4ef6c2cef14179.tar.gz | |
Close database connections (if applicable) on CachedSession.__exit__ and close()
Diffstat (limited to 'requests_cache/backends/mongodb.py')
| -rw-r--r-- | requests_cache/backends/mongodb.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/requests_cache/backends/mongodb.py b/requests_cache/backends/mongodb.py index 7623319..6d4175d 100644 --- a/requests_cache/backends/mongodb.py +++ b/requests_cache/backends/mongodb.py @@ -136,6 +136,9 @@ class MongoDict(BaseStorage): def clear(self): self.collection.drop() + def close(self): + self.connection.close() + class MongoPickleDict(MongoDict): """Same as :class:`MongoDict`, but serializes values before saving. |
