fix: dont check servers so many times

This commit is contained in:
decentral1se 2021-11-19 15:50:17 +01:00
parent 1b836dbab6
commit d821975aa2
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 6 additions and 2 deletions

View File

@ -71,9 +71,13 @@ can take some time.
}
sort.Sort(config.ByServerAndType(apps))
alreadySeen := make(map[string]bool)
for _, app := range apps {
if err := ssh.EnsureHostKey(app.Server); err != nil {
logrus.Fatal(fmt.Sprintf(internal.SSHFailMsg, app.Server))
if _, ok := alreadySeen[app.Server]; !ok {
if err := ssh.EnsureHostKey(app.Server); err != nil {
logrus.Fatal(fmt.Sprintf(internal.SSHFailMsg, app.Server))
}
alreadySeen[app.Server] = true
}
}