MCPcopy
hub / github.com/syncthing/syncthing / startWatch

Method startWatch

lib/model/folder.go:1045–1052  ·  view source on GitHub ↗

startWatch should only ever be called synchronously. If you want to use this asynchronously, you should probably use scheduleWatchRestart instead.

(ctx context.Context)

Source from the content-addressed store, hash-verified

1043// startWatch should only ever be called synchronously. If you want to use
1044// this asynchronously, you should probably use scheduleWatchRestart instead.
1045func (f *folder) startWatch(ctx context.Context) {
1046 watchCtx, cancel := context.WithCancel(ctx)
1047 f.watchMut.Lock()
1048 f.watchChan = make(chan []string)
1049 f.watchCancel = cancel
1050 f.watchMut.Unlock()
1051 go f.monitorWatch(watchCtx)
1052}
1053
1054// monitorWatch starts the filesystem watching and retries every minute on failure.
1055// It should not be used except in startWatch.

Callers 2

ServeMethod · 0.95
restartWatchMethod · 0.95

Calls 2

monitorWatchMethod · 0.95
UnlockMethod · 0.80

Tested by

no test coverage detected