From abc41d21082550ac4a92421830cb97fa3dbacb02 Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Mon, 23 Dec 2019 20:53:11 +0000 Subject: [PATCH] Update queue-worker to print body Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- cmd/up.go | 17 ++++++++++++++++- pkg/supervisor.go | 12 ++++++------ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/cmd/up.go b/cmd/up.go index e3cb42c..ec00220 100644 --- a/cmd/up.go +++ b/cmd/up.go @@ -49,12 +49,27 @@ func runUp(_ *cobra.Command, _ []string) error { "write_timeout=60s", "upstream_timeout=65s", "faas_nats_address=nats", - "faas_nats_port=8222", + "faas_nats_port=4222", }, Image: "docker.io/openfaas/gateway:0.17.4", Mounts: []pkg.Mount{}, Caps: []string{"CAP_NET_RAW"}, }, + pkg.Service{ + Name: "queue-worker", + Env: []string{ + "faas_nats_address=nats", + "faas_nats_port=4222", + "gateway_invoke=true", + "faas_gateway_address=gateway", + "ack_wait=5m5s", + "max_inflight=1", + "faas_print_body=true", + }, + Image: "docker.io/openfaas/queue-worker:0.8.4", + Mounts: []pkg.Mount{}, + Caps: []string{"CAP_NET_RAW"}, + }, } start := time.Now() diff --git a/pkg/supervisor.go b/pkg/supervisor.go index af2b8cd..31970e3 100644 --- a/pkg/supervisor.go +++ b/pkg/supervisor.go @@ -95,13 +95,13 @@ func (s *Supervisor) Start(svcs []Service) error { status, _ := t.Status(ctx) fmt.Println("Status:", status.Status) - if status.Status == containerd.Running { - log.Println("need to kill", svc.Name) - err := killTask(ctx, t) - if err != nil { - return fmt.Errorf("error killing task %s, %s, %s", container.ID(), svc.Name, err) - } + // if status.Status == containerd.Running { + log.Println("need to kill", svc.Name) + err := killTask(ctx, t) + if err != nil { + return fmt.Errorf("error killing task %s, %s, %s", container.ID(), svc.Name, err) } + // } } err = container.Delete(ctx, containerd.WithSnapshotCleanup)