diff --git a/backend/go-app/main.go b/backend/go-app/main.go index e7756dc0..33383850 100755 --- a/backend/go-app/main.go +++ b/backend/go-app/main.go @@ -1965,6 +1965,7 @@ func executeCloudAction(action shuffle.CloudSyncJob, apikey string) error { return err } + defer newresp.Body.Close() respBody, err := ioutil.ReadAll(newresp.Body) if err != nil { return err @@ -3513,15 +3514,13 @@ func remoteOrgJobHandler(org shuffle.Org, interval int) error { ) req.Header.Add("Authorization", fmt.Sprintf(`Bearer %s`, org.SyncConfig.Apikey)) - - //log.Printf("[INFO] Sending org sync with autho %s", org.SyncConfig.Apikey) - newresp, err := client.Do(req) if err != nil { //log.Printf("Failed request in org sync: %s", err) return err } + defer newresp.Body.Close() respBody, err := ioutil.ReadAll(newresp.Body) if err != nil { log.Printf("[ERROR] Failed body read in job sync: %s", err) @@ -3574,6 +3573,8 @@ func runInitEs(ctx context.Context) { log.Printf("[DEBUG] Getting organizations for Elasticsearch/Opensearch") activeOrgs, err := shuffle.GetAllOrgs(ctx) + log.Printf("[DEBUG] Got %d organizations to look into", len(activeOrgs)) + setUsers := false _ = setUsers if err != nil { @@ -3697,7 +3698,7 @@ func runInitEs(ctx context.Context) { for _, schedule := range schedules { if strings.ToLower(schedule.Environment) == "cloud" { - log.Printf("Skipping cloud schedule") + log.Printf("[DEBUG] Skipping cloud schedule") continue } @@ -3705,7 +3706,9 @@ func runInitEs(ctx context.Context) { //log.Printf("Schedule time: every %d seconds", schedule.Seconds) jobret, err := newscheduler.Every(schedule.Seconds).Seconds().NotImmediately().Run(job(schedule)) if err != nil { - log.Printf("Failed to schedule workflow: %s", err) + log.Printf("[ERROR] Failed to start schedule for workflow %s: %s", schedule.WorkflowId, err) + } else { + log.Printf("[DEBUG] Successfully started schedule for workflow %s", schedule.WorkflowId) } scheduledJobs[schedule.Id] = jobret @@ -4725,7 +4728,7 @@ func initHandlers() { log.Printf("[DEBUG] Initialized Shuffle database connection. Setting up environment.") if elasticConfig == "elasticsearch" { - time.Sleep(5 * time.Second) + time.Sleep(10 * time.Second) go runInitEs(ctx) } else { //go shuffle.runInit(ctx) diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 32fb67ef..83656aa4 100755 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -705,7 +705,7 @@ func handleWorkflowQueue(resp http.ResponseWriter, request *http.Request) { // Will make sure transactions are always ran for an execution. This is recursive if it fails. Allowed to fail up to 5 times func runWorkflowExecutionTransaction(ctx context.Context, attempts int64, workflowExecutionId string, actionResult shuffle.ActionResult, resp http.ResponseWriter) { - log.Printf("[DEBUG] Running workflow execution transaction for %s", workflowExecutionId) + log.Printf("[DEBUG][%s] Running workflow execution update", workflowExecutionId) // Should start a tx for the execution here workflowExecution, err := shuffle.GetWorkflowExecution(ctx, workflowExecutionId) @@ -1063,10 +1063,6 @@ func handleExecution(id string, workflow shuffle.Workflow, request *http.Request } } - err = shuffle.SetWorkflowExecution(ctx, workflowExecution, true) - if err != nil { - log.Printf("[ERROR] Failed setting workflow execution during init (2): %s", err) - } err = imageCheckBuilder(execInfo.ImageNames) if err != nil { @@ -1573,6 +1569,11 @@ func handleExecution(id string, workflow shuffle.Workflow, request *http.Request workflowExecution.ExecutionOrg = workflow.ExecutingOrg.Id } + err = shuffle.SetWorkflowExecution(ctx, workflowExecution, true) + if err != nil { + log.Printf("[ERROR] Failed setting workflow execution during init (2): %s", err) + } + var allEnvs []shuffle.Environment if len(workflowExecution.ExecutionOrg) > 0 { //log.Printf("[INFO] Executing ORG: %s", workflowExecution.ExecutionOrg) diff --git a/frontend/package.json b/frontend/package.json index 0cb2e764..fbababec 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,6 +14,7 @@ "@mui/styles": "^5.14.0", "@mui/x-data-grid": "^5.17.11", "@mui/x-date-pickers": "^6.11.1", + "@uiw/codemirror-theme-vscode": "^4.21.20", "@uiw/codemirror-themes": "^4.21.9", "@uiw/react-codemirror": "^4.21.9", "@use-it/interval": "^1.0.0", diff --git a/frontend/src/components/EditWorkflow.jsx b/frontend/src/components/EditWorkflow.jsx index 81dacd85..05e57184 100644 --- a/frontend/src/components/EditWorkflow.jsx +++ b/frontend/src/components/EditWorkflow.jsx @@ -269,35 +269,8 @@ const EditWorkflow = (props) => { />