Skip to content
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

Automatic cache updates #90

Closed
dbrgn opened this issue Oct 22, 2019 · 0 comments · Fixed by #115
Closed

Automatic cache updates #90

dbrgn opened this issue Oct 22, 2019 · 0 comments · Fixed by #115

Comments

@dbrgn
Copy link
Collaborator

dbrgn commented Oct 22, 2019

As discussed in #73, there could be a config option where - if it's set - the cache automatically refreshes itself when it's outdated.

Implementation notes (copied from here):

This would require a slight reorganization of the main function:

  • Handle args.flag_config_path and args.flag_seed_config right after handling args.flag_version (simply move up the code blocks)
  • Move the config loading code in print_page into the main function, right after the args.flag_seed_config handling block
  • In src/config.rs, add the new config elements to the RawConfig and Config structs and add the defaults to RawConfig::new().

The default configuration can be generated with tldr --seed-config. My suggestion would be:

[updates]
auto_update = false
auto_update_interval_hours = 720

(The auto_update_interval_hours could then be set to MAX_CACHE_AGE * 24 by default.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant