Skip to content

Commit 52a1d4f

Browse files
authored
Add sleep before retrying stack up again (#1665)
1 parent 31dedaa commit 52a1d4f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/stack/boot.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"path/filepath"
1111
"strings"
12+
"time"
1213

1314
"github.com/elastic/elastic-package/internal/builder"
1415
"github.com/elastic/elastic-package/internal/configuration/locations"
@@ -91,7 +92,9 @@ func BootUp(options Options) error {
9192
// As a workaround, try to give another chance to docker-compose if only
9293
// elastic-agent failed.
9394
if onlyElasticAgentFailed(options) {
94-
fmt.Println("Elastic Agent failed to start, trying again.")
95+
sleepTime := 10 * time.Second
96+
fmt.Printf("Elastic Agent failed to start, trying again in %s.\n", sleepTime)
97+
time.Sleep(sleepTime)
9598
err = dockerComposeUp(options)
9699
}
97100
if err != nil {

0 commit comments

Comments
 (0)