Fixes async payload passing for #68.

This commit is contained in:
Travis Reeder
2017-06-20 11:32:51 -07:00
parent c94dab3d45
commit 8c96d3ba2f
23 changed files with 276 additions and 225 deletions

View File

@@ -127,7 +127,8 @@ func startAsyncRunners(ctx context.Context, url string, rnr *Runner, ds models.D
}
ctx, log := common.LoggerWithFields(ctx, logrus.Fields{"call_id": task.ID})
log.Debug("Running task:", task.ID)
log.Info("Running task:", task.ID)
// log.Infof("Task: %+v", task)
wg.Add(1)

View File

@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io"
"strings"
"sync"
"time"
@@ -63,6 +64,10 @@ 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())