MCPcopy
hub / github.com/syncthing/syncthing / ModTimeWindow

Method ModTimeWindow

lib/config/folderconfiguration.go:141–155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139}
140
141func (f FolderConfiguration) ModTimeWindow() time.Duration {
142 dur := time.Duration(f.RawModTimeWindowS) * time.Second
143 if f.RawModTimeWindowS < 1 && build.IsAndroid {
144 if usage, err := disk.Usage(f.Filesystem().URI()); err != nil {
145 dur = 2 * time.Second
146 l.Debugf(`Detecting FS at "%v" on android: Setting mtime window to 2s: err == "%v"`, f.Path, err)
147 } else if strings.HasPrefix(strings.ToLower(usage.Fstype), "ext2") || strings.HasPrefix(strings.ToLower(usage.Fstype), "ext3") || strings.HasPrefix(strings.ToLower(usage.Fstype), "ext4") {
148 l.Debugf(`Detecting FS at %v on android: Leaving mtime window at 0: usage.Fstype == "%v"`, f.Path, usage.Fstype)
149 } else {
150 dur = 2 * time.Second
151 l.Debugf(`Detecting FS at "%v" on android: Setting mtime window to 2s: usage.Fstype == "%v"`, f.Path, usage.Fstype)
152 }
153 }
154 return dur
155}
156
157func (f *FolderConfiguration) CreateMarker() error {
158 if err := f.CheckPath(); !errors.Is(err, ErrMarkerMissing) {

Callers 2

reportDataMethod · 0.80
newFolderFunction · 0.80

Calls 4

FilesystemMethod · 0.95
DebugfMethod · 0.80
UsageMethod · 0.65
URIMethod · 0.65

Tested by

no test coverage detected