waitForPostgreSQL polls until PostgreSQL accepts connections or times out.
(timeout time.Duration)
| 545 | |
| 546 | // waitForPostgreSQL polls until PostgreSQL accepts connections or times out. |
| 547 | func waitForPostgreSQL(timeout time.Duration) error { |
| 548 | deadline := time.Now().Add(timeout) |
| 549 | for time.Now().Before(deadline) { |
| 550 | if pgIsReady() { |
| 551 | return nil |
| 552 | } |
| 553 | time.Sleep(500 * time.Millisecond) |
| 554 | } |
| 555 | return fmt.Errorf("timed out after %s waiting for postgresql", timeout) |
| 556 | } |
| 557 | |
| 558 | func startMySQL() error { |
| 559 | log.Println("--- Starting MySQL ---") |
no test coverage detected