add timeout
This commit is contained in:
parent
fd62711571
commit
cddb2223e9
@ -90,6 +90,7 @@ func (c *Config) Load() error {
|
||||
ssh.PublicKeys(s.signer),
|
||||
},
|
||||
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
|
||||
Timeout: 5 * time.Second,
|
||||
}
|
||||
|
||||
s.client, err = ssh.Dial("tcp", v.Addr, s.config)
|
||||
@ -97,7 +98,6 @@ func (c *Config) Load() error {
|
||||
if *debugFlag {
|
||||
log.Printf("Config.Load : ssh.Dial(%s) : %s", k, err)
|
||||
}
|
||||
return err
|
||||
} else {
|
||||
v.online = true
|
||||
session, err := s.client.NewSession()
|
||||
@ -168,6 +168,9 @@ func (c *Config) Load() error {
|
||||
if _, ok := cfg.Box[before.Box()]; !ok {
|
||||
return fmt.Errorf("No box defined for before : %s", string(before))
|
||||
}
|
||||
if !cfg.Box[before.Box()].online {
|
||||
return fmt.Errorf("Before box offline for app : %s", app.Name)
|
||||
}
|
||||
}
|
||||
for val, after := range app.After {
|
||||
_, err = regexp.Compile(val)
|
||||
@ -183,6 +186,9 @@ func (c *Config) Load() error {
|
||||
if _, ok := cfg.Box[after.Box()]; !ok {
|
||||
return fmt.Errorf("No box defined for after : %s", string(after))
|
||||
}
|
||||
if !cfg.Box[after.Box()].online {
|
||||
return fmt.Errorf("After box offline for app : %s", app.Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by version.sh (@generated) DO NOT EDIT.
|
||||
package main
|
||||
var githash = "762c538"
|
||||
var buildstamp = "2022-04-16_12:55:05"
|
||||
var commits = "29"
|
||||
var version = "762c538-b29 - 2022-04-16_12:55:05"
|
||||
var githash = "fd62711"
|
||||
var buildstamp = "2022-04-16_13:08:54"
|
||||
var commits = "30"
|
||||
var version = "fd62711-b30 - 2022-04-16_13:08:54"
|
||||
|
Loading…
Reference in New Issue
Block a user