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)
| 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). |
| 1846 | func (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 | |
| 1863 | func (f *sendReceiveFolder) moveForConflict(name, lastModBy string, scanChan chan<- string) error { |
| 1864 | if isConflict(name) { |
no test coverage detected