Skip to content

Commit

Permalink
Disable cache by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mre committed Jan 5, 2022
1 parent 2e4ac80 commit 1ac3c85
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ USAGE:
lychee [FLAGS] [OPTIONS] <inputs>...
FLAGS:
--cache Use request cache stored on disk at `.lycheecache`
--dump Don't perform any link checking. Instead, dump all the links extracted from inputs that
would be checked
-E, --exclude-all-private Exclude all private IPs from checking.
Expand All @@ -212,7 +213,6 @@ FLAGS:
--glob-ignore-case Ignore case when expanding filesystem path glob inputs
--help Prints help information
-i, --insecure Proceed for server connections considered insecure (invalid TLS)
--no-cache Do not load request cache (stored in `.lycheecache`) from disk
-n, --no-progress Do not show progress bar.
This is recommended for non-interactive shells (e.g. for continuous integration)
--offline Only check local files and block network requests
Expand Down
4 changes: 2 additions & 2 deletions lychee-bin/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn load_config() -> Result<LycheeOptions> {
/// This returns an `Option` as starting without a cache is a common scenario
/// and we silently discard errors on purpose
fn load_cache(cfg: &Config) -> Option<Cache> {
if cfg.no_cache {
if !cfg.cache {
return None;
}

Expand Down Expand Up @@ -211,7 +211,7 @@ async fn run(opts: &LycheeOptions) -> Result<i32> {
commands::check(client, cache, requests, &opts.config).await?;
write_stats(stats, &opts.config)?;

if !opts.config.no_cache {
if opts.config.cache {
cache.store(LYCHEE_CACHE_FILE)?;
}
exit_code
Expand Down
6 changes: 3 additions & 3 deletions lychee-bin/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ lazy_static! {
static ref MAX_CONCURRENCY_STR: String = MAX_CONCURRENCY.to_string();
static ref MAX_REDIRECTS_STR: String = MAX_REDIRECTS.to_string();
static ref STRUCTOPT_HELP_MSG_CACHE: String = format!(
"Do not load request cache (stored in `{}`) from disk",
"Use request cache stored on disk at `{}`",
LYCHEE_CACHE_FILE
);
static ref STRUCTOPT_HELP_MSG_IGNORE_FILE: String = format!(
Expand Down Expand Up @@ -148,7 +148,7 @@ pub(crate) struct Config {
#[structopt(help = &STRUCTOPT_HELP_MSG_CACHE)]
#[structopt(long)]
#[serde(default)]
pub(crate) no_cache: bool,
pub(crate) cache: bool,

#[structopt(
long,
Expand Down Expand Up @@ -331,7 +331,7 @@ impl Config {

// Keys with defaults to assign
verbose: false;
no_cache: false;
cache: false;
no_progress: false;
max_redirects: MAX_REDIRECTS;
max_concurrency: MAX_CONCURRENCY;
Expand Down

0 comments on commit 1ac3c85

Please sign in to comment.