Simplify Network Check Plugin - Drop Self-Checks from Connectivity Plugin #436

Merged
sarah merged 3 commits from nc into master 2022-03-22 20:01:08 +00:00
2 changed files with 10 additions and 10 deletions
Showing only changes of commit dae2d358bc - Show all commits

View File

@ -18,19 +18,19 @@ const NetworkCheckSuccess = "Success"
// networkCheck is a convenience plugin for testing high level availability of onion services // networkCheck is a convenience plugin for testing high level availability of onion services
type networkCheck struct { type networkCheck struct {
bus event.Manager bus event.Manager
queue event.Queue queue event.Queue
onion string onion string
acn connectivity.ACN acn connectivity.ACN
breakChan chan bool breakChan chan bool
running bool running bool
offline bool offline bool
offlineLock sync.Mutex offlineLock sync.Mutex
} }
// NewNetworkCheck returns a Plugin that when started will attempt various network tests // NewNetworkCheck returns a Plugin that when started will attempt various network tests
func NewNetworkCheck(onion string, bus event.Manager, acn connectivity.ACN) Plugin { func NewNetworkCheck(onion string, bus event.Manager, acn connectivity.ACN) Plugin {
nc := &networkCheck{onion:onion, bus: bus, acn: acn, queue: event.NewQueue(), breakChan: make(chan bool, 1)} nc := &networkCheck{onion: onion, bus: bus, acn: acn, queue: event.NewQueue(), breakChan: make(chan bool, 1)}
return nc return nc
} }

View File

@ -240,7 +240,7 @@ func checkCwtchProfileBackupFile(srcFile string) (string, error) {
profileFileType := parts[1] profileFileType := parts[1]
_, hexErr := hex.DecodeString(dir) _, hexErr := hex.DecodeString(dir)
if dir == "." || dir == ".." || len(dir) !=32 || hexErr != nil { if dir == "." || dir == ".." || len(dir) != 32 || hexErr != nil {
return "", errors.New("invalid profile name") return "", errors.New("invalid profile name")
} }