We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fbcc19 commit c869379Copy full SHA for c869379
src/web/page/templates.rs
@@ -50,13 +50,16 @@ impl TemplateData {
50
};
51
52
let (tx, rx) = channel();
53
+ // Set a 2 second event debounce for the watcher
54
let mut watcher = watcher(tx, Duration::from_secs(2)).unwrap();
55
56
watcher
57
.watch("tera-templates", RecursiveMode::Recursive)
58
.unwrap();
59
60
thread::spawn(move || {
61
+ // The watcher needs to be moved into the thread so that it's not dropped (when dropped,
62
+ // all updates cease)
63
let _watcher = watcher;
64
65
while rx.recv().is_ok() {
0 commit comments