mstruebing / tldr

Golang command line client for tldr https://github.com/tldr-pages/tldr
MIT License
262 stars 24 forks source link

Only check remote is reachable when ttl timeout. #52

Closed wudong closed 4 years ago

wudong commented 4 years ago

What I did: only call repo.isReachable() when it is actually needed.

Why I did it: Calling repo.isReachable() each time give me a few seconds delay in my environment (WSL2/Ubuntu). Didn't check other environment.

Because the code path is executed for every invocation of the command line, it gives me a unbearable delay for using it.

codecov-commenter commented 4 years ago

Codecov Report

Merging #52 into master will decrease coverage by 4.33%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #52      +/-   ##
==========================================
- Coverage   67.03%   62.70%   -4.34%     
==========================================
  Files           3        3              
  Lines         182      185       +3     
==========================================
- Hits          122      116       -6     
- Misses         34       44      +10     
+ Partials       26       25       -1     
Impacted Files Coverage Δ
cache/cache.go 53.33% <0.00%> (-5.76%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7d2b4a4...6d36cb1. Read the comment docs.