MCPcopy
hub / github.com/syncthing/syncthing / getHealthErrorWithoutIgnores

Method getHealthErrorWithoutIgnores

lib/model/folder.go:365–383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

363}
364
365func (f *folder) getHealthErrorWithoutIgnores() error {
366 // Check for folder errors, with the most serious and specific first and
367 // generic ones like out of space on the home disk later.
368
369 if err := f.CheckPath(); err != nil {
370 return err
371 }
372
373 if minFree := f.model.cfg.Options().MinHomeDiskFree; minFree.Value > 0 {
374 dbPath := locations.Get(locations.Database)
375 if usage, err := fs.NewFilesystem(fs.FilesystemTypeBasic, dbPath).Usage("."); err == nil {
376 if err = config.CheckFreeSpace(minFree, usage); err != nil {
377 return fmt.Errorf("insufficient space on disk for database (%v): %w", dbPath, err)
378 }
379 }
380 }
381
382 return nil
383}
384
385func (f *folder) pull(ctx context.Context) (success bool, err error) {
386 f.pullFailTimer.Stop()

Callers 3

pullMethod · 0.95
newScanBatchMethod · 0.80

Calls 6

GetFunction · 0.92
NewFilesystemFunction · 0.92
CheckFreeSpaceFunction · 0.92
CheckPathMethod · 0.80
OptionsMethod · 0.65
UsageMethod · 0.65

Tested by

no test coverage detected