Skip to content

Commit 8cb6d90

Browse files
committed
cleanup and remove unwanted sleep
1 parent fb4e922 commit 8cb6d90

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

cmd/sshproxy/sshproxy.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,6 @@ func mainExitCode() int {
375375
keepAliveChan = tmpKeepAliveChan
376376
cli.Enable()
377377
}
378-
} else {
379-
// Avoid looping too fast in case of a loss of etcd
380-
time.Sleep(time.Second)
381378
}
382379
case <-ctx.Done():
383380
return

pkg/utils/etcd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ func (c *Client) GetAllGroups(allFlag bool) (map[string]*FlatGroup, error) {
585585

586586
// IsAlive checks if etcd client is still usable.
587587
func (c *Client) IsAlive() bool {
588-
return c.cli != nil && c.active == true
588+
return c.cli != nil && c.active
589589
}
590590

591591
// Enable enables the etcd client.

test/centos-image/sshproxy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ func TestSCP(t *testing.T) {
684684
line := "dump: etcd"
685685
addLineSSHProxyConf(line)
686686
defer removeLineSSHProxyConf(line)
687-
line = "stats_interval: 5s"
687+
line = "etcd_stats_interval: 5s"
688688
addLineSSHProxyConf(line)
689689
defer removeLineSSHProxyConf(line)
690690
}

0 commit comments

Comments
 (0)