mirror of
https://github.com/sxyazi/yazi.git
synced 2024-12-03 01:22:50 +03:00
fix: ignore peek task cancellation error
This commit is contained in:
parent
d7d000c213
commit
cd84386ead
@ -31,7 +31,7 @@ function M:preload()
|
||||
return 1
|
||||
end
|
||||
|
||||
local child = Command("ffmpegthumbnailer"):args({
|
||||
local child, code = Command("ffmpegthumbnailer"):args({
|
||||
"-q",
|
||||
"6",
|
||||
"-c",
|
||||
@ -47,6 +47,7 @@ function M:preload()
|
||||
}):spawn()
|
||||
|
||||
if not child then
|
||||
ya.err("spawn `ffmpegthumbnailer` command returns " .. tostring(code))
|
||||
return 0
|
||||
end
|
||||
|
||||
|
@ -21,7 +21,7 @@ pub fn peek(exec: &Exec, file: yazi_shared::fs::File, skip: usize) -> Cancellati
|
||||
lua.set_hook(
|
||||
HookTriggers::new().on_calls().on_returns().every_nth_instruction(2000),
|
||||
move |_, _| {
|
||||
if ct1.is_cancelled() { Err("cancelled".into_lua_err()) } else { Ok(()) }
|
||||
if ct1.is_cancelled() { Err("Peek task cancelled".into_lua_err()) } else { Ok(()) }
|
||||
},
|
||||
);
|
||||
|
||||
@ -46,7 +46,9 @@ pub fn peek(exec: &Exec, file: yazi_shared::fs::File, skip: usize) -> Cancellati
|
||||
});
|
||||
|
||||
if let Err(e) = result {
|
||||
error!("{e}");
|
||||
if !e.to_string().contains("Peek task cancelled") {
|
||||
error!("{e}");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user