File tree 2 files changed +7
-3
lines changed
Sources/AWSLambdaRuntimeCore
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 12
12
//
13
13
//===----------------------------------------------------------------------===//
14
14
15
- // commented out as long as we have a fix for Swift 6 language mode CI
16
-
17
15
#if DEBUG
18
16
import Dispatch
19
17
import 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
76
76
77
77
} else {
78
78
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
80
82
try await Lambda . withLocalServer ( invocationEndpoint: Lambda . env ( " LOCAL_LAMBDA_SERVER_INVOCATION_ENDPOINT " ) )
81
83
{
82
84
@@ -92,6 +94,10 @@ public final class LambdaRuntime<Handler>: @unchecked Sendable where Handler: St
92
94
)
93
95
}
94
96
}
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
95
101
}
96
102
}
97
103
}
You can’t perform that action at this time.
0 commit comments