Skip to content

Commit

Permalink
feat: studio one man queue
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbx9da4 committed Aug 29, 2024
1 parent 48dfa45 commit 2ad3e24
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions internal/studio/studioHandlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,8 @@ func NewStudioHandlers(ctx context.Context, workflowRunner *run.Workflow) (*Stud
}

func (h *StudioHandlers) getLastCompletedRunResult(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
fmt.Println("Getting run")

// Wait for the run to finish
h.syncCondition.L.Lock()
for h.running {
fmt.Println("Waiting for run to finish")
h.syncCondition.Wait()
}
defer h.syncCondition.L.Unlock()
Expand All @@ -79,22 +75,17 @@ func (h *StudioHandlers) getLastCompletedRunResult(ctx context.Context, w http.R
}

func (h *StudioHandlers) reRun(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
fmt.Println("Re-running")
// Wait for the run to finish
h.syncCondition.L.Lock()
for h.running {
fmt.Println("Waiting for run to finish inside re-run")
h.syncCondition.Wait()
}

fmt.Println("Start re-run")

h.running = true
defer func() {
h.syncCondition.L.Unlock()
h.running = false
h.syncCondition.Broadcast()
fmt.Println("Run finished")
}()

cloned, err := h.WorkflowRunner.Clone(h.Ctx, run.WithSkipCleanup(), run.WithLinting())
Expand Down Expand Up @@ -233,8 +224,6 @@ func (h *StudioHandlers) suggestMethodNames(ctx context.Context, w http.Response
// ---------------------------------

func (h *StudioHandlers) getLastCompletedRunResultInner(ctx context.Context, w http.ResponseWriter, r *http.Request) error {
fmt.Println("getLastCompletedRunResultInner")

res := components.RunResponse{
TargetResults: make(map[string]components.TargetRunSummary),
}
Expand Down

0 comments on commit 2ad3e24

Please sign in to comment.