startWatch should only ever be called synchronously. If you want to use this asynchronously, you should probably use scheduleWatchRestart instead.
(ctx context.Context)
| 1043 | // startWatch should only ever be called synchronously. If you want to use |
| 1044 | // this asynchronously, you should probably use scheduleWatchRestart instead. |
| 1045 | func (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. |
no test coverage detected