(ctx context.Context)
| 27 | } |
| 28 | |
| 29 | func (w *Watcher) start(ctx context.Context) error { |
| 30 | if errAddConfig := w.watcher.Add(w.configPath); errAddConfig != nil { |
| 31 | log.Errorf("failed to watch config file %s: %v", w.configPath, errAddConfig) |
| 32 | return errAddConfig |
| 33 | } |
| 34 | log.Debugf("watching config file: %s", w.configPath) |
| 35 | |
| 36 | if errAddAuthDir := w.watcher.Add(w.authDir); errAddAuthDir != nil { |
| 37 | log.Errorf("failed to watch auth directory %s: %v", w.authDir, errAddAuthDir) |
| 38 | return errAddAuthDir |
| 39 | } |
| 40 | log.Debugf("watching auth directory: %s", w.authDir) |
| 41 | |
| 42 | go w.processEvents(ctx) |
| 43 | |
| 44 | w.reloadClients(true, nil, false) |
| 45 | return nil |
| 46 | } |
| 47 | |
| 48 | func (w *Watcher) processEvents(ctx context.Context) { |
| 49 | for { |
no test coverage detected