| 561 | } |
| 562 | |
| 563 | func (m *model) newFolder(cfg config.FolderConfiguration, cacheIgnoredFiles bool) error { |
| 564 | m.mut.Lock() |
| 565 | defer m.mut.Unlock() |
| 566 | |
| 567 | m.addAndStartFolderLocked(cfg, cacheIgnoredFiles) |
| 568 | |
| 569 | // Cluster configs might be received and processed before reaching this |
| 570 | // point, i.e. before the folder is started. If that's the case, start |
| 571 | // index senders here. |
| 572 | m.indexHandlers.Each(func(_ protocol.DeviceID, r *indexHandlerRegistry) error { |
| 573 | runner, _ := m.folderRunners.Get(cfg.ID) |
| 574 | r.RegisterFolderState(cfg, runner) |
| 575 | return nil |
| 576 | }) |
| 577 | |
| 578 | return nil |
| 579 | } |
| 580 | |
| 581 | func (m *model) UsageReportingStats(report *contract.Report, version int, preview bool) { |
| 582 | if version >= 3 { |