Skip to content

Commit 6242607

Browse files
committed
Rename the cache instance to response_cache so there isn't a conflict with cache module.
1 parent 34eaece commit 6242607

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

sunlight/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ def _attempt_to_load_apikey():
6969
_attempt_to_load_apikey()
7070

7171

72-
cache = sunlight.cache.response_cache
72+
response_cache = sunlight.cache.response_cache

sunlight/cache.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
'''
2-
The cache is disabled by default. Use it like so:
2+
.. module:: cache
33
4-
import logging
5-
from sunlight import cache
4+
The cache is disabled by default. Use it like so: ::
65
7-
cache.enable('mongo')
8-
cache.logger.setLevel(logging.DEBUG)
6+
import logging
7+
from sunlight import response_cache
8+
response_cache.enable('mongo')
9+
response_cache.logger.setLevel(logging.DEBUG)
910
1011
Note: the implementation below doesn't bother with cache expiration.
1112
Typical use case is caching API calls during an expensive build process.

0 commit comments

Comments
 (0)