From 11c28e884618a8bbc212e978d40c9e42cb78eeba Mon Sep 17 00:00:00 2001 From: Travis Reeder Date: Wed, 21 Jun 2017 11:59:38 -0700 Subject: [PATCH] Fixed input --- api/runner/async_runner.go | 2 ++ api/runner/worker.go | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/api/runner/async_runner.go b/api/runner/async_runner.go index 898d74c3f..eb056cd5f 100644 --- a/api/runner/async_runner.go +++ b/api/runner/async_runner.go @@ -9,6 +9,7 @@ import ( "net" "net/http" "net/url" + "strings" "sync" "time" @@ -48,6 +49,7 @@ func getCfg(t *models.Task) *task.Config { AppName: t.AppName, Env: t.EnvVars, Ready: make(chan struct{}), + Stdin: strings.NewReader(t.Payload), } if t.Timeout == nil || *t.Timeout <= 0 { cfg.Timeout = DefaultTimeout diff --git a/api/runner/worker.go b/api/runner/worker.go index d1f1b2966..7c7e0c1e3 100644 --- a/api/runner/worker.go +++ b/api/runner/worker.go @@ -5,7 +5,6 @@ import ( "errors" "fmt" "io" - "strings" "sync" "time" @@ -64,10 +63,6 @@ func (rnr *Runner) RunTrackedTask(newTask *models.Task, ctx context.Context, cfg startedAt := strfmt.DateTime(time.Now()) newTask.StartedAt = startedAt - // set payload as Stdin - // fmt.Printf("ABOUT TO PASS IN PAYLOAD: %v", newTask.Payload) - cfg.Stdin = strings.NewReader(newTask.Payload) - result, err := rnr.RunTask(ctx, cfg) completedAt := strfmt.DateTime(time.Now())