()
| 405 | } |
| 406 | |
| 407 | func (w *Watcher) persistConfigAsync() { |
| 408 | if w == nil || w.storePersister == nil { |
| 409 | return |
| 410 | } |
| 411 | go func() { |
| 412 | ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) |
| 413 | defer cancel() |
| 414 | if err := w.storePersister.PersistConfig(ctx); err != nil { |
| 415 | log.Errorf("failed to persist config change: %v", err) |
| 416 | } |
| 417 | }() |
| 418 | } |
| 419 | |
| 420 | func (w *Watcher) persistAuthAsync(message string, paths ...string) { |
| 421 | if w == nil || w.storePersister == nil { |