return waitAllServices
This commit is contained in:
committed by
Christian Richter
parent
a869bb5166
commit
5ea5a8dddb
@@ -153,7 +153,24 @@ func IsOpencloudRunning() bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func waitAllServices(startTime time.Time, timeout time.Duration) {
|
||||||
|
timeoutS := timeout * time.Second
|
||||||
|
|
||||||
|
c := exec.Command(config.Get("bin"), "list")
|
||||||
|
_, err := c.CombinedOutput()
|
||||||
|
if err != nil {
|
||||||
|
if time.Since(startTime) <= timeoutS {
|
||||||
|
time.Sleep(500 * time.Millisecond)
|
||||||
|
waitAllServices(startTime, timeout)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.Println("All services are up")
|
||||||
|
}
|
||||||
|
|
||||||
func WaitForConnection() (bool, string) {
|
func WaitForConnection() (bool, string) {
|
||||||
|
waitAllServices(time.Now(), 30)
|
||||||
|
|
||||||
transport := &http.Transport{
|
transport := &http.Transport{
|
||||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user