File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Sources/AWSLambdaRuntimeCore Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1212//
1313//===----------------------------------------------------------------------===//
1414
15- // commented out as long as we have a fix for Swift 6 language mode CI
16-
1715#if DEBUG
1816import Dispatch
1917import Logging
Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ public final class LambdaRuntime<Handler>: @unchecked Sendable where Handler: St
7676
7777 } else {
7878
79- // we're not running on Lambda, let's start a local server for testing
79+ #if DEBUG
80+ // we're not running on Lambda and we're compiled in DEBUG mode,
81+ // let's start a local server for testing
8082 try await Lambda . withLocalServer ( invocationEndpoint: Lambda . env ( " LOCAL_LAMBDA_SERVER_INVOCATION_ENDPOINT " ) )
8183 {
8284
@@ -92,6 +94,10 @@ public final class LambdaRuntime<Handler>: @unchecked Sendable where Handler: St
9294 )
9395 }
9496 }
97+ #else
98+ // in release mode, we can't start a local server because the local server code is not compiled.
99+ throw LambdaRuntimeError ( code: . missingLambdaRuntimeAPIEnvironmentVariable)
100+ #endif
95101 }
96102 }
97103}
You can’t perform that action at this time.
0 commit comments