Skip to content

Commit ee59497

Browse files
committed
Change TLDR_CACHE_MAX_AGE default
1 parent 67e52a9 commit ee59497

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Cache is downloaded from `TLDR_DOWNLOAD_CACHE_LOCATION` (defaults to the one des
7777
* `TLDR_CACHE_ENABLED` (default is `1`):
7878
* If set to `1`, the client will first try to load from cache, and fall back to fetching from the internet if the cache doesn't exist or is too old.
7979
* If set to `0`, the client will fetch from the internet, and fall back to the cache if the page cannot be fetched from the internet.
80-
* `TLDR_CACHE_MAX_AGE` (default is `24`): maximum age of the cache in hours to be considered as valid when `TLDR_CACHE_ENABLED` is set to `1`.
80+
* `TLDR_CACHE_MAX_AGE` (default is `168`): maximum age of the cache in hours to be considered as valid when `TLDR_CACHE_ENABLED` is set to `1`.
8181

8282
#### Cache location
8383

tldr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
'https://tldr-pages.github.io/assets/tldr.zip'
3131
)
3232

33-
USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0
34-
USE_CACHE = int(os.environ.get('TLDR_CACHE_ENABLED', '1')) > 0
35-
MAX_CACHE_AGE = int(os.environ.get('TLDR_CACHE_MAX_AGE', 24))
33+
USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0 # Defaults to True
34+
USE_CACHE = int(os.environ.get('TLDR_CACHE_ENABLED', '1')) > 0 # Defaults to True
35+
MAX_CACHE_AGE = int(os.environ.get('TLDR_CACHE_MAX_AGE', 168)) # Defaults to 168 hours (a week)
3636

3737
URLOPEN_CONTEXT = None
3838
if int(os.environ.get('TLDR_ALLOW_INSECURE', '0')) == 1:

0 commit comments

Comments
 (0)