MCPcopy
hub / github.com/syncthing/syncthing / newScanBatch

Method newScanBatch

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

Source from the content-addressed store, hash-verified

578}
579
580func (f *folder) newScanBatch() *scanBatch {
581 b := &scanBatch{
582 f: f,
583 toRemove: make([]string, 0, maxToRemove),
584 deleted: make(map[string]struct{}),
585 }
586 b.updateBatch = NewFileInfoBatch(func(fs []protocol.FileInfo) error {
587 if err := b.f.getHealthErrorWithoutIgnores(); err != nil {
588 b.f.sl.Debug("Stopping scan due to folder error", slogutil.Error(err))
589 return err
590 }
591 b.f.updateLocalsFromScanning(fs)
592 clear(b.deleted)
593 return nil
594 })
595 return b
596}
597
598func (b *scanBatch) Remove(item string) {
599 b.toRemove = append(b.toRemove, item)

Callers 1

scanSubdirsMethod · 0.95

Calls 5

ErrorFunction · 0.92
NewFileInfoBatchFunction · 0.85
clearFunction · 0.85

Tested by

no test coverage detected