Made EOF errors stay longer to NOT lead to organizations missing during restarts

This commit is contained in:
Frikky
2024-04-30 16:59:01 +02:00
parent 04db5c14a8
commit 69802f50e5
+3 -3
View File
@@ -3583,8 +3583,8 @@ func runInitEs(ctx context.Context) {
setUsers := false
_ = setUsers
if err != nil {
if fmt.Sprintf("%s", err) == "EOF" {
time.Sleep(7 * time.Second)
if fmt.Sprintf("%s", err) == "EOF" || strings.Contains(fmt.Sprintf("%s", err), "bad status") {
time.Sleep(10 * time.Second)
runInitEs(ctx)
return
}
@@ -3668,7 +3668,7 @@ func runInitEs(ctx context.Context) {
if strings.Contains(os.Getenv("SHUFFLE_OPENSEARCH_URL"), "https") {
log.Printf("[INFO] Waiting during init to make sure the opensearch instance is up and running with security features properly")
time.Sleep(15 * time.Second)
time.Sleep(30 * time.Second)
}
schedules, err := shuffle.GetAllSchedules(ctx, "ALL")