From e8f115848f460be339e86e992ed75ac5322ed2ea Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Fri, 6 Nov 2020 19:57:27 +0300 Subject: [PATCH] avoid reloading directories modified in the future Related #453 --- nav.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nav.go b/nav.go index aff2657..df5b312 100644 --- a/nav.go +++ b/nav.go @@ -327,8 +327,16 @@ func (nav *nav) checkDir(dir *dir) { switch { case s.ModTime().After(dir.loadTime): + now := time.Now() + + // XXX: Linux builtin exFAT drivers are able to predict modifications in the future + // https://bugs.launchpad.net/ubuntu/+source/ubuntu-meta/+bug/1872504 + if s.ModTime().After(now) { + return + } + dir.loading = true - dir.loadTime = time.Now() + dir.loadTime = now go func() { nd := newDir(dir.path) nd.sort()