fix: set connection timeouts + clean up bad contexts
All checks were successful
continuous-integration/drone/push Build is passing

Closes coop-cloud/organising#205.
This commit is contained in:
2021-10-18 10:48:43 +02:00
parent 9dfbd21c61
commit d1e42752e2
5 changed files with 351 additions and 2 deletions

View File

@ -118,6 +118,10 @@ All communication between Abra and the server will use this SSH connection.
ctx := context.Background()
cl, err := client.New(domainName)
if err != nil {
logrus.Warn("cleaning up context due to connection failure")
if err := client.DeleteContext(domainName); err != nil {
logrus.Fatal(err)
}
logrus.Fatal(err)
}
@ -125,6 +129,10 @@ All communication between Abra and the server will use this SSH connection.
if strings.Contains(err.Error(), "command not found") {
logrus.Fatalf("docker is not installed on '%s'?", domainName)
} else {
logrus.Warn("cleaning up context due to connection failure")
if err := client.DeleteContext(domainName); err != nil {
logrus.Fatal(err)
}
logrus.Fatalf("unable to make a connection to '%s'?", domainName)
}
logrus.Debug(err)