lib/config: Allow sub-second watcher delay (fixes #7859) (#7864)

Allow the watcher delay to take fractional values, effectively allowing
for much shorter delays. The minimum value is limited at 0.01, which
effectively translates to 10ms. This is required in order to guarantee
that there is still enough time to aggregate multiple single change
events.

Signed-off-by: Tomasz Wilczyński <twilczynski@naver.com>
This commit is contained in:
tomasz1986
2023-03-18 08:50:38 +01:00
committed by GitHub
parent 59de7048bd
commit 358cf25cff
5 changed files with 174 additions and 178 deletions
+2
View File
@@ -198,6 +198,8 @@ func (f *FolderConfiguration) prepare(myID protocol.DeviceID, existingDevices ma
if f.FSWatcherDelayS <= 0 {
f.FSWatcherEnabled = false
f.FSWatcherDelayS = 10
} else if f.FSWatcherDelayS < 0.01 {
f.FSWatcherDelayS = 0.01
}
if f.Versioning.CleanupIntervalS > MaxRescanIntervalS {