mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Fixed input
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -48,6 +49,7 @@ func getCfg(t *models.Task) *task.Config {
|
|||||||
AppName: t.AppName,
|
AppName: t.AppName,
|
||||||
Env: t.EnvVars,
|
Env: t.EnvVars,
|
||||||
Ready: make(chan struct{}),
|
Ready: make(chan struct{}),
|
||||||
|
Stdin: strings.NewReader(t.Payload),
|
||||||
}
|
}
|
||||||
if t.Timeout == nil || *t.Timeout <= 0 {
|
if t.Timeout == nil || *t.Timeout <= 0 {
|
||||||
cfg.Timeout = DefaultTimeout
|
cfg.Timeout = DefaultTimeout
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -64,10 +63,6 @@ func (rnr *Runner) RunTrackedTask(newTask *models.Task, ctx context.Context, cfg
|
|||||||
startedAt := strfmt.DateTime(time.Now())
|
startedAt := strfmt.DateTime(time.Now())
|
||||||
newTask.StartedAt = startedAt
|
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)
|
result, err := rnr.RunTask(ctx, cfg)
|
||||||
|
|
||||||
completedAt := strfmt.DateTime(time.Now())
|
completedAt := strfmt.DateTime(time.Now())
|
||||||
|
|||||||
Reference in New Issue
Block a user