Added base part to documentation to help with support
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/md5"
|
||||
"strconv"
|
||||
|
||||
//"crypto/tls"
|
||||
//"crypto/x509"
|
||||
@@ -1029,6 +1030,7 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
chatDisabled := false
|
||||
if os.Getenv("SHUFFLE_CHAT_DISABLED") == "true" {
|
||||
chatDisabled = true
|
||||
}
|
||||
@@ -4083,6 +4085,19 @@ func runInitEs(ctx context.Context) {
|
||||
// FIXME: Have this for all envs in all orgs (loop and find).
|
||||
if len(parsedApikey) > 0 {
|
||||
cleanupSchedule := 300
|
||||
|
||||
if len(os.Getenv("SHUFFLE_RERUN_SCHEDULE")) > 0 {
|
||||
newfrequency, err := strconv.Atoi(os.Getenv("SHUFFLE_RERUN_SCHEDULE"))
|
||||
if err == nil {
|
||||
cleanupSchedule = newfrequency
|
||||
|
||||
if cleanupSchedule < 300 {
|
||||
log.Printf("[WARNING] A Cleanupschedule of less than 300 seconds won't help.")
|
||||
cleanupSchedule = 300
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
environments := []string{"Shuffle"}
|
||||
log.Printf("[DEBUG] Starting schedule setup for execution cleanup every %d seconds. Running first immediately.", cleanupSchedule)
|
||||
cleanupJob := func() func() {
|
||||
|
||||
@@ -321,8 +321,8 @@ func handleGetWorkflowqueue(resp http.ResponseWriter, request *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(executionRequests.Data) > 10 {
|
||||
executionRequests.Data = executionRequests.Data[0:9]
|
||||
if len(executionRequests.Data) > 50 {
|
||||
executionRequests.Data = executionRequests.Data[0:49]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -895,8 +895,8 @@ func handleExecution(id string, workflow shuffle.Workflow, request *http.Request
|
||||
|
||||
workflowExecution, execInfo, _, err := shuffle.PrepareWorkflowExecution(ctx, workflow, request, 10)
|
||||
if err != nil {
|
||||
log.Printf("[WARNING] Failed in prepareExecution: %s", err)
|
||||
return shuffle.WorkflowExecution{}, fmt.Sprintf("Failed preparration: %s", err), err
|
||||
log.Printf("[WARNING] Failed in prepareExecution for execution Id %s: %s", workflowExecution.ExecutionId, err)
|
||||
return workflowExecution, fmt.Sprintf("Failed preparration: %s", err), err
|
||||
}
|
||||
|
||||
err = imageCheckBuilder(execInfo.ImageNames)
|
||||
@@ -1134,7 +1134,6 @@ func executeWorkflow(resp http.ResponseWriter, request *http.Request) {
|
||||
user.ActiveOrg.Users = []shuffle.UserMini{}
|
||||
workflow.ExecutingOrg = user.ActiveOrg
|
||||
workflowExecution, executionResp, err := handleExecution(fileId, *workflow, request)
|
||||
|
||||
if err == nil {
|
||||
resp.WriteHeader(200)
|
||||
resp.Write([]byte(fmt.Sprintf(`{"success": true, "execution_id": "%s", "authorization": "%s"}`, workflowExecution.ExecutionId, workflowExecution.Authorization)))
|
||||
@@ -1142,7 +1141,7 @@ func executeWorkflow(resp http.ResponseWriter, request *http.Request) {
|
||||
}
|
||||
|
||||
resp.WriteHeader(500)
|
||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "reason": "%s"}`, executionResp)))
|
||||
resp.Write([]byte(fmt.Sprintf(`{"success": false, "execution_id": "%s", "authorization": "%s", "reason": "%s"}`, workflowExecution.ExecutionId, workflowExecution.Authorization, executionResp)))
|
||||
}
|
||||
|
||||
func stopSchedule(resp http.ResponseWriter, request *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user