summaryrefslogtreecommitdiff
path: root/requests_cache
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2022-04-15 18:39:14 -0500
committerJordan Cook <jordan.cook@pioneer.com>2022-04-15 19:18:33 -0500
commitce0e7c19c3f93dca01a9a209dd3388d9f6f938e9 (patch)
treeae9906188d022bc542292ac1ffa26343886e99e4 /requests_cache
parentd3a572ae7dd2b2c1b3db8bafe1338a3cac8e950b (diff)
downloadrequests-cache-ce0e7c19c3f93dca01a9a209dd3388d9f6f938e9.tar.gz
Skip setting TTL for redirects collection
Diffstat (limited to 'requests_cache')
-rw-r--r--requests_cache/backends/mongodb.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/requests_cache/backends/mongodb.py b/requests_cache/backends/mongodb.py
index 59b5c52..16b65ff 100644
--- a/requests_cache/backends/mongodb.py
+++ b/requests_cache/backends/mongodb.py
@@ -115,7 +115,6 @@ logger = getLogger(__name__)
# TODO: TTL tests
# TODO: Is there any reason to support custom serializers here?
# TODO: Save items with different cache keys to avoid conflicts with old serialization format?
-# TODO: Set TTL for redirects? Or just clean up with remove_invalid_redirects()?
class MongoCache(BaseCache):
"""MongoDB cache backend
@@ -141,15 +140,14 @@ class MongoCache(BaseCache):
)
def set_ttl(self, ttl: Union[int, timedelta], overwrite: bool = False):
- """Set MongoDB TTL for all collections. Notes:
+ """Create or update a TTL index. Notes:
* This will have no effect if TTL is already set
* To overwrite an existing TTL index, use ``overwrite=True``
- * Use ``ttl=None, overwrite=True`` to remove the TTL index
* This may take some time to complete, depending on the size of your cache
+ * Use ``ttl=None, overwrite=True`` to remove the TTL index
"""
self.responses.set_ttl(ttl, overwrite=overwrite)
- self.redirects.set_ttl(ttl, overwrite=overwrite)
class MongoDict(BaseStorage):