Skip to content

Commit

Permalink
Update queue-worker to print body
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Dec 23, 2019
1 parent 9ba6478 commit abc41d2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
17 changes: 16 additions & 1 deletion cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
12 changes: 6 additions & 6 deletions pkg/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit abc41d2

Please sign in to comment.