Generate cache and save it on first run
This commit is contained in:
parent
1b15bd678c
commit
a56db54b72
|
@ -18,7 +18,11 @@ fn main_with_cache(request: &str, regen: bool) -> Result<()> {
|
||||||
|
|
||||||
let (cache, just_generated) = match Cache::read() {
|
let (cache, just_generated) = match Cache::read() {
|
||||||
Ok(c) => (c, false),
|
Ok(c) => (c, false),
|
||||||
Err(_) => (Cache::generate(), true),
|
Err(_) => {
|
||||||
|
let cache = Cache::generate();
|
||||||
|
cache.write()?;
|
||||||
|
(cache, true)
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
let only_match = match cache.find_interactive(&request) {
|
let only_match = match cache.find_interactive(&request) {
|
||||||
|
|
Loading…
Reference in New Issue