mirror of
https://github.com/FliegendeWurst/ripgrep-all.git
synced 2024-11-24 12:24:56 +00:00
fix caching
This commit is contained in:
parent
d06d27709b
commit
d8fcf7b015
@ -78,7 +78,6 @@ impl FileAdapter for FFmpegAdapter {
|
|||||||
if !probe.status.success() {
|
if !probe.status.success() {
|
||||||
return Err(format_err!("ffprobe failed: {:?}", probe.status));
|
return Err(format_err!("ffprobe failed: {:?}", probe.status));
|
||||||
}
|
}
|
||||||
println!("{}", String::from_utf8_lossy(&probe.stdout));
|
|
||||||
let p: FFprobeOutput = serde_json::from_slice(&probe.stdout)?;
|
let p: FFprobeOutput = serde_json::from_slice(&probe.stdout)?;
|
||||||
(p.streams.iter().count() > 0)
|
(p.streams.iter().count() > 0)
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use failure::Fallible;
|
use failure::Fallible;
|
||||||
|
use log::*;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -97,8 +97,10 @@ pub fn rga_preproc(ai: AdaptInfo) -> Result<(), Error> {
|
|||||||
.finish()?;
|
.finish()?;
|
||||||
if let Some(cached) = compressed {
|
if let Some(cached) = compressed {
|
||||||
eprintln!("compressed len: {}", cached.len());
|
eprintln!("compressed len: {}", cached.len());
|
||||||
};
|
Ok(Some(cached))
|
||||||
Ok(None)
|
} else {
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
Box::new(|cached| {
|
Box::new(|cached| {
|
||||||
let stdouti = std::io::stdout();
|
let stdouti = std::io::stdout();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
use failure::{format_err, Fallible};
|
use failure::{format_err, Fallible};
|
||||||
|
use log::*;
|
||||||
use std::sync::{Arc, RwLock};
|
use std::sync::{Arc, RwLock};
|
||||||
|
|
||||||
pub fn open() -> Fallible<Arc<RwLock<dyn PreprocCache>>> {
|
pub fn open() -> Fallible<Arc<RwLock<dyn PreprocCache>>> {
|
||||||
@ -71,10 +72,12 @@ impl PreprocCache for LmdbCache {
|
|||||||
|
|
||||||
match cached {
|
match cached {
|
||||||
Some(rkv::Value::Blob(cached)) => {
|
Some(rkv::Value::Blob(cached)) => {
|
||||||
|
debug!("got cached");
|
||||||
callback(cached)?;
|
callback(cached)?;
|
||||||
}
|
}
|
||||||
Some(_) => Err(format_err!("Integrity: value not blob"))?,
|
Some(_) => Err(format_err!("Integrity: value not blob"))?,
|
||||||
None => {
|
None => {
|
||||||
|
debug!("did not get cached");
|
||||||
drop(reader);
|
drop(reader);
|
||||||
if let Some(got) = runner()? {
|
if let Some(got) = runner()? {
|
||||||
let mut writer = db_env.write().map_err(|p| {
|
let mut writer = db_env.write().map_err(|p| {
|
||||||
|
Loading…
Reference in New Issue
Block a user