Skip to content

Commit

Permalink
Add sleep before retrying stack up again (#1665)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodm authored Feb 8, 2024
1 parent 31dedaa commit 52a1d4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/stack/boot.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"os"
"path/filepath"
"strings"
"time"

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

0 comments on commit 52a1d4f

Please sign in to comment.