File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -126,18 +126,20 @@ public class Runtime {
126
126
let dispatchGroup = DispatchGroup ( )
127
127
dispatchGroup. enter ( )
128
128
129
- handler. apply ( inputData: inputData, context: context) { handlerResult in
130
- switch handlerResult {
131
- case . success( let outputData) :
132
- self . postInvocationResponse ( for: context. awsRequestId, httpBody: outputData)
133
- case . failure( let error) :
134
- self . postInvocationError ( for: context. awsRequestId, error: error)
135
- }
136
-
129
+ var handlerResult : HandlerResult ?
130
+ handler. apply ( inputData: inputData, context: context) { result in
131
+ handlerResult = result
137
132
dispatchGroup. leave ( )
138
133
}
139
134
140
135
dispatchGroup. wait ( )
136
+
137
+ switch handlerResult! {
138
+ case . success( let outputData) :
139
+ postInvocationResponse ( for: context. awsRequestId, httpBody: outputData)
140
+ case . failure( let error) :
141
+ postInvocationError ( for: context. awsRequestId, error: error)
142
+ }
141
143
}
142
144
}
143
145
}
You can’t perform that action at this time.
0 commit comments