MCPcopy
hub / github.com/syncthing/syncthing / addAndStartFolderLocked

Method addAndStartFolderLocked

lib/model/model.go:338–347  ·  view source on GitHub ↗

Need to hold lock on m.mut when calling this.

(cfg config.FolderConfiguration, cacheIgnoredFiles bool)

Source from the content-addressed store, hash-verified

336
337// Need to hold lock on m.mut when calling this.
338func (m *model) addAndStartFolderLocked(cfg config.FolderConfiguration, cacheIgnoredFiles bool) {
339 ignores := ignore.New(cfg.Filesystem(), ignore.WithCache(cacheIgnoredFiles))
340 if cfg.Type != config.FolderTypeReceiveEncrypted {
341 if err := ignores.Load(".stignore"); err != nil && !fs.IsNotExist(err) {
342 slog.Error("Failed to load ignores", slogutil.Error(err))
343 }
344 }
345
346 m.addAndStartFolderLockedWithIgnores(cfg, ignores)
347}
348
349// Only needed for testing, use addAndStartFolderLocked instead.
350func (m *model) addAndStartFolderLockedWithIgnores(cfg config.FolderConfiguration, ignores *ignore.Matcher) {

Callers 2

restartFolderMethod · 0.95
newFolderMethod · 0.95

Calls 8

NewFunction · 0.92
WithCacheFunction · 0.92
IsNotExistFunction · 0.92
ErrorFunction · 0.92
FilesystemMethod · 0.80
ErrorMethod · 0.65
LoadMethod · 0.45

Tested by

no test coverage detected