Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit d076e2a

Browse files
committed
Show bootstrap process output. Pass bootstrap index to runtime
1 parent 3355286 commit d076e2a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

main.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,15 @@ func main() {
270270

271271
for i := 0; i < numberOfinvokers; i++ {
272272
fmt.Println("Starting bootstrap", i+1)
273-
go func() {
274-
if err := exec.Command("sh", "-c", environment["LAMBDA_TASK_ROOT"]+"/bootstrap").Run(); err != nil {
273+
go func(i int) {
274+
cmd := exec.Command("sh", "-c", environment["LAMBDA_TASK_ROOT"]+"/bootstrap")
275+
cmd.Env = append(os.Environ(), fmt.Sprintf("BOOTSTRAP_INDEX=%d", i))
276+
cmd.Stdout = os.Stdout
277+
cmd.Stderr = os.Stderr
278+
if err := cmd.Run(); err != nil {
275279
log.Fatalln(err)
276280
}
277-
}()
281+
}(i)
278282
}
279283

280284
taskRouter := http.NewServeMux()

0 commit comments

Comments
 (0)