MCPcopy
hub / github.com/syncthing/syncthing / newFolder

Method newFolder

lib/model/model.go:563–579  ·  view source on GitHub ↗
(cfg config.FolderConfiguration, cacheIgnoredFiles bool)

Source from the content-addressed store, hash-verified

561}
562
563func (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
581func (m *model) UsageReportingStats(report *contract.Report, version int, preview bool) {
582 if version >= 3 {

Callers 3

initFoldersMethod · 0.95
CommitConfigurationMethod · 0.95

Calls 5

UnlockMethod · 0.80
EachMethod · 0.80
RegisterFolderStateMethod · 0.80
GetMethod · 0.65

Tested by 1