Skip to content

Commit c869379

Browse files
committed
Comment on updater
1 parent 1fbcc19 commit c869379

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/web/page/templates.rs

+3
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,16 @@ impl TemplateData {
5050
};
5151

5252
let (tx, rx) = channel();
53+
// Set a 2 second event debounce for the watcher
5354
let mut watcher = watcher(tx, Duration::from_secs(2)).unwrap();
5455

5556
watcher
5657
.watch("tera-templates", RecursiveMode::Recursive)
5758
.unwrap();
5859

5960
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)
6063
let _watcher = watcher;
6164

6265
while rx.recv().is_ok() {

0 commit comments

Comments
 (0)