File tree Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Expand file tree Collapse file tree 1 file changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -47,26 +47,13 @@ extension OpenAPILambda {
47
47
try OpenAPILambdaHandler < Self > ( ) . handler
48
48
}
49
49
50
- /// Invokes the OpenAPI Lambda handler function for this OpenAPI Lambda implementation
51
- /// - Parameters:
52
- /// - event: The event for the Lambda function
53
- /// - context: The Lambda context
54
- /// - Throws: An error if the handler function fails
55
- /// - Returns: The output of the handler function
56
- private static func handler( event: Event , context: LambdaContext ) async throws -> Output {
57
- try await Self . handler ( ) ( event, context)
58
- }
59
-
60
50
/// Start the Lambda Runtime with the Lambda handler function for this OpenAPI Lambda implementation with a custom logger,
61
51
/// when one is given.
62
52
/// - Parameter logger: The logger to use for Lambda runtime logging
63
53
public static func run( logger: Logger ? = nil ) async throws {
64
54
65
- let lambdaRuntime = LambdaRuntime { ( event: Event , context: LambdaContext ) in
66
- try await Self . handler ( event: event, context: context)
67
- }
68
-
69
- // let lambdaRuntime = try LambdaRuntime(body: Self.handler())
55
+ let _logger = logger ?? Logger ( label: " OpenAPILambda " )
56
+ let lambdaRuntime = try LambdaRuntime ( logger: _logger, body: Self . handler ( ) )
70
57
try await lambdaRuntime. run ( )
71
58
}
72
59
}
You can’t perform that action at this time.
0 commit comments