Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cmd/localstack/custom_interop.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"go.amzn.com/lambda/rapidcore/standalone"
"io"
"net/http"
"strconv"
"strings"
"time"
)
Expand Down Expand Up @@ -139,6 +140,14 @@ func NewCustomInteropServer(lsOpts *LsOpts, delegate rapidcore.InteropServer, lo
log.Fatalln(err)
}
}
// optional sleep. can be used for debugging purposes
if lsOpts.PostInvokeWaitMS != "" {
waitMS, err := strconv.Atoi(lsOpts.PostInvokeWaitMS)
if err != nil {
log.Fatalln(err)
}
time.Sleep(time.Duration(waitMS) * time.Millisecond)
}
timeoutDuration := time.Duration(timeout) * time.Second
memorySize := GetEnvOrDie("AWS_LAMBDA_FUNCTION_MEMORY_SIZE")
PrintEndReports(invokeR.InvokeId, "", memorySize, invokeStart, timeoutDuration, logCollector)
Expand Down
4 changes: 4 additions & 0 deletions cmd/localstack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type LsOpts struct {
InitLogLevel string
EdgePort string
EnableXRayTelemetry string
PostInvokeWaitMS string
}

func GetEnvOrDie(env string) string {
Expand Down Expand Up @@ -54,6 +55,7 @@ func InitLsOpts() *LsOpts {
EnableDnsServer: os.Getenv("LOCALSTACK_ENABLE_DNS_SERVER"),
EnableXRayTelemetry: os.Getenv("LOCALSTACK_ENABLE_XRAY_TELEMETRY"),
LocalstackIP: os.Getenv("LOCALSTACK_HOSTNAME"),
PostInvokeWaitMS: os.Getenv("LOCALSTACK_POST_INVOKE_WAIT_MS"),
}
}

Expand All @@ -71,6 +73,8 @@ func UnsetLsEnvs() {
"LOCALSTACK_ENABLE_DNS_SERVER",
"LOCALSTACK_ENABLE_XRAY_TELEMETRY",
"LOCALSTACK_INIT_LOG_LEVEL",
"LOCALSTACK_POST_INVOKE_WAIT_MS",

// Docker container ID
"HOSTNAME",
// User
Expand Down