forked from toolshed/abra
		
	fix: time out on 60 sec + of converge checks
See coop-cloud/organising#246.
This commit is contained in:
		| @ -6,6 +6,7 @@ import ( | |||||||
| 	"io" | 	"io" | ||||||
| 	"io/ioutil" | 	"io/ioutil" | ||||||
| 	"strings" | 	"strings" | ||||||
|  | 	"time" | ||||||
|  |  | ||||||
| 	abraClient "coopcloud.tech/abra/pkg/client" | 	abraClient "coopcloud.tech/abra/pkg/client" | ||||||
| 	"coopcloud.tech/abra/pkg/upstream/convert" | 	"coopcloud.tech/abra/pkg/upstream/convert" | ||||||
| @ -479,5 +480,13 @@ func waitOnService(ctx context.Context, cl *dockerclient.Client, serviceID strin | |||||||
| 	}() | 	}() | ||||||
|  |  | ||||||
| 	go io.Copy(ioutil.Discard, pipeReader) | 	go io.Copy(ioutil.Discard, pipeReader) | ||||||
| 	return <-errChan |  | ||||||
|  | 	timeout := 60 * time.Second | ||||||
|  |  | ||||||
|  | 	select { | ||||||
|  | 	case err := <-errChan: | ||||||
|  | 		return err | ||||||
|  | 	case <-time.After(timeout): | ||||||
|  | 		return fmt.Errorf("%s has still not converged (%s second timeout)?", serviceID, timeout) | ||||||
|  | 	} | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user