Backport critical changes from watcher protection draft

This commit is contained in:
Simon Repp
2024-04-16 10:11:56 +02:00
parent de1ac22a9b
commit a2cda33c0f
+10 -3
View File
@@ -70,10 +70,17 @@ pub fn watch (context: Arc<Context>) {
}
if last_change.elapsed().as_millis() > DEBOUNCE_PERIOD_MILLIS as u128 {
for path in queue.drain(..) {
dbg!(&path);
context.update_from_filesystem(&path);
if !queue.is_empty() {
let site = context.get_site();
for path in queue.drain(..) {
context.update_from_filesystem(&path, &site);
}
context.compute_job_queue();
}
last_change = Instant::now();
}
}
});