Reduce file watcher debounce period

500ms introduced a visual lag between file save and display update.
This commit is contained in:
Joe Wilm 2017-09-05 09:01:07 -07:00 committed by Joe Wilm
parent a7b50e0eb8
commit 2f095d4096
2 changed files with 2 additions and 2 deletions

View File

@ -1474,7 +1474,7 @@ impl Monitor {
Monitor {
_thread: ::util::thread::spawn_named("config watcher", move || {
let (tx, rx) = mpsc::channel();
let mut watcher = watcher(tx, Duration::from_millis(500)).unwrap();
let mut watcher = watcher(tx, Duration::from_millis(10)).unwrap();
let config_path = ::std::fs::canonicalize(path)
.expect("canonicalize config path");

View File

@ -537,7 +537,7 @@ impl QuadRenderer {
if cfg!(feature = "live-shader-reload") {
::std::thread::spawn(move || {
let (tx, rx) = ::std::sync::mpsc::channel();
let mut watcher = watcher(tx, Duration::from_millis(500)).expect("create file watcher");
let mut watcher = watcher(tx, Duration::from_millis(10)).expect("create file watcher");
watcher.watch(TEXT_SHADER_F_PATH, RecursiveMode::NonRecursive)
.expect("watch fragment shader");
watcher.watch(TEXT_SHADER_V_PATH, RecursiveMode::NonRecursive)