refactor: better representation of 3-valued target state
This commit is contained in:
1 parent
520c7286c4
commit
b8b3e6f9cd
2 files changed
+17
-12
No files matched your search
+2
-2
@@ -175,12 +175,12 @@ func NewLocalConnectionStatusSlice(cm *ConnectionMaker) []LocalConnectionStatus
|
||||
for address, target := range cm.targets {
|
||||
var state, info string
|
||||
switch {
|
||||
case target.connected:
|
||||
case target.state == TargetConnected:
|
||||
continue
|
||||
case target.lastError == nil:
|
||||
state = "connecting"
|
||||
info = ""
|
||||
case target.attempting:
|
||||
case target.state == TargetAttempting:
|
||||
state = "retrying"
|
||||
info = target.lastError.Error()
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user