MCPcopy
hub / github.com/gogf/gf / SetWatchErrorHandler

Method SetWatchErrorHandler

os/gcfg/gcfg_loader.go:209–214  ·  view source on GitHub ↗

SetWatchErrorHandler sets an error handling function that will be called when Load operations fail during Watch

(errorFunc func(ctx context.Context, err error))

Source from the content-addressed store, hash-verified

207
208// SetWatchErrorHandler sets an error handling function that will be called when Load operations fail during Watch
209func (l *Loader[T]) SetWatchErrorHandler(errorFunc func(ctx context.Context, err error)) *Loader[T] {
210 l.mutex.Lock()
211 defer l.mutex.Unlock()
212 l.watchErrorFunc = errorFunc
213 return l
214}
215
216// SetReuseTargetStruct sets whether to reuse the same target struct or create a new one on updates
217func (l *Loader[T]) SetReuseTargetStruct(reuse bool) *Loader[T] {

Callers 1

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by 1