-
-
Notifications
You must be signed in to change notification settings - Fork 104
Change TLDR_CACHE_MAX_AGE default #170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change TLDR_CACHE_MAX_AGE default #170
Conversation
Do I need to remove the comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the changes, but I think the added comments are not really necessary. Either way, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @CleanMachine1!
Looking at the commit history let's wait for @MasterOdin to merge this?
Hrm, some of the builds are failing here? |
Those are all because of the comments. As already said, I don't think they're necessary. |
@MasterOdin Could we get a review? |
README.md
Outdated
@@ -77,7 +77,7 @@ Cache is downloaded from `TLDR_DOWNLOAD_CACHE_LOCATION` (defaults to the one des | |||
* `TLDR_CACHE_ENABLED` (default is `1`): | |||
* 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. | |||
* 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. | |||
* `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`. | |||
* `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`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we specify what 168
is here?
(default is
168
hours, or one week)
tldr.py
Outdated
@@ -32,7 +32,7 @@ | |||
|
|||
USE_NETWORK = int(os.environ.get('TLDR_NETWORK_ENABLED', '1')) > 0 | |||
USE_CACHE = int(os.environ.get('TLDR_CACHE_ENABLED', '1')) > 0 | |||
MAX_CACHE_AGE = int(os.environ.get('TLDR_CACHE_MAX_AGE', 24)) | |||
MAX_CACHE_AGE = int(os.environ.get('TLDR_CACHE_MAX_AGE', 168)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change this to be 24 * 7
? Makes it a bit easier to quickly parse.
Can I get some reviews here please |
I feel 24 hours is extreme, and it annoys me when I first started using this client.
On average I probably only use tldr 1-2 times a day, therefore I have to wait each time for it to download a new cache everyday, which normally includes the additions of 0-10 pages/changes.
It goes from nearly instant with using an out of date cache to waiting a few seconds for a command if you use an updated cache which is just slightly annoying.
Simple change, however others may find this controversial 🤷
edit: PS, I forgot to mention that I had already changed the cache date for my .zshrc a weeks back, however the change I made, I felt needed to be standardized