mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Fix revalidation
This commit is contained in:
parent
aba0b5ad01
commit
34393c29ea
1 changed files with 3 additions and 15 deletions
|
|
@ -112,22 +112,10 @@ pub trait Engine: Sized {
|
||||||
|
|
||||||
fn read_link(&self) -> impl Future<Output = io::Result<PathBufDyn>>;
|
fn read_link(&self) -> impl Future<Output = io::Result<PathBufDyn>>;
|
||||||
|
|
||||||
fn revalidate(&self, mut file: File) -> impl Future<Output = io::Result<Option<File>>> {
|
fn revalidate(&self, file: File) -> impl Future<Output = io::Result<Option<File>>> {
|
||||||
async move {
|
async move {
|
||||||
let cha = if !file.is_link() {
|
let new = self.file().await?;
|
||||||
self.symlink_metadata().await?
|
if new.cha.hits(file.cha) { Ok(None) } else { Ok(Some(new)) }
|
||||||
} else if let Ok(new) = self.metadata().await {
|
|
||||||
file.cha.follow(Some(new))
|
|
||||||
} else {
|
|
||||||
self.symlink_metadata().await?
|
|
||||||
};
|
|
||||||
|
|
||||||
if cha.hits(file.cha) {
|
|
||||||
Ok(None)
|
|
||||||
} else {
|
|
||||||
file.cha = cha;
|
|
||||||
Ok(Some(file))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue