@@ -68,6 +68,13 @@ func NewCustomInteropServer(lsOpts *LsOpts, delegate rapidcore.InteropServer, lo
68
68
RuntimeId : lsOpts .RuntimeId ,
69
69
},
70
70
}
71
+ invokeTimeoutEnv := GetEnvOrDie ("AWS_LAMBDA_FUNCTION_TIMEOUT" )
72
+ invokeTimeoutSeconds , err := strconv .Atoi (invokeTimeoutEnv )
73
+ if err != nil {
74
+ log .Fatalln (err )
75
+ }
76
+ invokeTimeout := time .Second * time .Duration (invokeTimeoutSeconds )
77
+ server .delegate .SetInvokeTimeout (invokeTimeout )
71
78
72
79
// TODO: extract this
73
80
go func () {
@@ -88,12 +95,6 @@ func NewCustomInteropServer(lsOpts *LsOpts, delegate rapidcore.InteropServer, lo
88
95
}
89
96
90
97
invokeResp := & standalone.ResponseWriterProxy {}
91
- invokeTimeoutEnv := GetEnvOrDie ("AWS_LAMBDA_FUNCTION_TIMEOUT" )
92
- invokeTimeoutSeconds , err := strconv .Atoi (invokeTimeoutEnv )
93
- if err != nil {
94
- log .Fatalln (err )
95
- }
96
- invokeTimeout := time .Second * time .Duration (invokeTimeoutSeconds )
97
98
functionVersion := GetEnvOrDie ("AWS_LAMBDA_FUNCTION_VERSION" ) // default $LATEST
98
99
_ , _ = fmt .Fprintf (logCollector , "START RequestId: %s Version: %s\n " , invokeR .InvokeId , functionVersion )
99
100
@@ -106,7 +107,7 @@ func NewCustomInteropServer(lsOpts *LsOpts, delegate rapidcore.InteropServer, lo
106
107
CorrelationID : "invokeCorrelationID" ,
107
108
NeedDebugLogs : true ,
108
109
InvokedFunctionArn : invokeR .InvokedFunctionArn ,
109
- DeadlineNs : strconv . FormatInt ( invokeTimeout . Nanoseconds (), 10 ),
110
+ // DeadlineNs:
110
111
})
111
112
if err != nil {
112
113
log .Fatalln (err )
0 commit comments