MCPcopy Create free account
hub / github.com/PuerNya/git-proxy / loadDomainList

Function loadDomainList

main.go:370–387  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

368}
369
370func loadDomainList() (*fswatch.Watcher, error) {
371 err := loadDomainListData()
372 if err != nil {
373 return nil, err
374 }
375 watcher, err := fswatch.NewWatcher(fswatch.Options{
376 Path: []string{domainListPath},
377 Callback: func(path string) {
378 log.Info("Accept domain list changed, reloading")
379 loadDomainListData()
380 },
381 })
382 if err != nil {
383 log.Error(E.Cause(err, "Create accept domain list watcher"))
384 return nil, err
385 }
386 return watcher, nil
387}
388
389func loadDomainListData() error {
390 reader, err := NewFileReader(domainListPath)

Callers 1

runFunction · 0.85

Calls 2

loadDomainListDataFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected