MCPcopy
hub / github.com/syncthing/syncthing / pullScannerRoutine

Method pullScannerRoutine

lib/model/folder_sendrecv.go:1846–1861  ·  view source on GitHub ↗

pullScannerRoutine aggregates paths to be scanned after pulling. The scan is scheduled once when scanChan is closed (scanning can not happen during pulling).

(ctx context.Context, scanChan <-chan string)

Source from the content-addressed store, hash-verified

1844// pullScannerRoutine aggregates paths to be scanned after pulling. The scan is
1845// scheduled once when scanChan is closed (scanning can not happen during pulling).
1846func (f *sendReceiveFolder) pullScannerRoutine(ctx context.Context, scanChan <-chan string) {
1847 toBeScanned := make(map[string]struct{})
1848
1849 for path := range scanChan {
1850 toBeScanned[path] = struct{}{}
1851 }
1852
1853 if len(toBeScanned) != 0 {
1854 scanList := make([]string, 0, len(toBeScanned))
1855 for path := range toBeScanned {
1856 slog.DebugContext(ctx, "Scheduling scan after pulling", slogutil.FilePath(path))
1857 scanList = append(scanList, path)
1858 }
1859 f.Scan(scanList)
1860 }
1861}
1862
1863func (f *sendReceiveFolder) moveForConflict(name, lastModBy string, scanChan chan<- string) error {
1864 if isConflict(name) {

Callers 3

pullMethod · 0.95
revertMethod · 0.80
revertHandleDirsMethod · 0.80

Calls 2

FilePathFunction · 0.92
ScanMethod · 0.65

Tested by

no test coverage detected