()
| 139 | } |
| 140 | |
| 141 | func (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 | |
| 157 | func (f *FolderConfiguration) CreateMarker() error { |
| 158 | if err := f.CheckPath(); !errors.Is(err, ErrMarkerMissing) { |
no test coverage detected