Only act when we know a positive fact about the state of our watched file

This commit is contained in:
Tony Garnock-Jones 2016-11-29 12:19:34 +13:00
parent bde2d833bd
commit 3a3d216908
1 changed files with 3 additions and 2 deletions

View File

@ -72,9 +72,10 @@
(reloading? #f)))))
(field [previous-version #f])
(define/query-value latest-version #f (file-content pathstr counter $p) p)
(define/query-value latest-version 'unknown (file-content pathstr counter $p) p)
(begin/dataflow
(when (not (equal? (latest-version) (previous-version)))
(when (and (not (eq? (latest-version) 'unknown))
(not (equal? (latest-version) (previous-version))))
(if (latest-version)
(reload!)
(log-syndicate/reload-warning "Module ~v does not exist" pathstr))