()
| 578 | } |
| 579 | |
| 580 | func (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 | |
| 598 | func (b *scanBatch) Remove(item string) { |
| 599 | b.toRemove = append(b.toRemove, item) |
no test coverage detected