use `filesystem-change-evt' for collection paths only if low-latency
Specifically, this change disables the use of inotify() for detecting changes to collection-links files, because the latency is too large on some (many?) Linux configurations. (The fallback is to detect changes to a links file by reading the whole content every time.)
This commit is contained in:
parent
df79198e6e
commit
9aee8b53d9
File diff suppressed because it is too large
Load Diff
|
@ -466,15 +466,17 @@
|
|||
"(lambda() #f)"
|
||||
"(lambda()(raise exn)))))"
|
||||
"(let((dir-evt"
|
||||
"(and(vector-ref(system-type 'fs-change) 2) "
|
||||
"(let loop((path path))"
|
||||
"(let-values(((base name dir?)(split-path path)))"
|
||||
"(and(path? base)"
|
||||
"(if(directory-exists? base)"
|
||||
"(filesystem-change-evt base(lambda() #f))"
|
||||
"(loop base)))))))"
|
||||
"(loop base))))))))"
|
||||
"(if(not(file-exists? path))"
|
||||
"(cons #f dir-evt)"
|
||||
"(let((evt(filesystem-change-evt path(lambda() #f))))"
|
||||
"(let((evt(and(vector-ref(system-type 'fs-change) 2) "
|
||||
"(filesystem-change-evt path(lambda() #f)))))"
|
||||
"(when dir-evt(filesystem-change-evt-cancel dir-evt))"
|
||||
"(cons"
|
||||
"(let((p(open-input-file path)))"
|
||||
|
|
|
@ -555,15 +555,17 @@
|
|||
(lambda () #f)
|
||||
(lambda () (raise exn)))))
|
||||
(let ([dir-evt
|
||||
(let loop ([path path])
|
||||
(let-values ([(base name dir?) (split-path path)])
|
||||
(and (path? base)
|
||||
(if (directory-exists? base)
|
||||
(filesystem-change-evt base (lambda () #f))
|
||||
(loop base)))))])
|
||||
(and (vector-ref (system-type 'fs-change) 2) ; 'low-latency ?
|
||||
(let loop ([path path])
|
||||
(let-values ([(base name dir?) (split-path path)])
|
||||
(and (path? base)
|
||||
(if (directory-exists? base)
|
||||
(filesystem-change-evt base (lambda () #f))
|
||||
(loop base))))))])
|
||||
(if (not (file-exists? path))
|
||||
(cons #f dir-evt)
|
||||
(let ([evt (filesystem-change-evt path (lambda () #f))])
|
||||
(let ([evt (and (vector-ref (system-type 'fs-change) 2) ; 'low-latency ?
|
||||
(filesystem-change-evt path (lambda () #f)))])
|
||||
(when dir-evt (filesystem-change-evt-cancel dir-evt))
|
||||
(cons
|
||||
(let ([p (open-input-file path)])
|
||||
|
|
Loading…
Reference in New Issue
Block a user