Skip to content

Commit 2111ea5

Browse files
committed
Move Lifecycle completely into EventLoop
1 parent 995fa48 commit 2111ea5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/AWSLambdaRuntimeCore/Lambda.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,19 @@ public enum Lambda {
104104
var result: Result<Int, Error>!
105105
MultiThreadedEventLoopGroup.withCurrentThreadAsEventLoop { eventLoop in
106106
let lifecycle = Lifecycle(eventLoop: eventLoop, logger: logger, configuration: configuration, factory: factory)
107+
#if DEBUG
107108
let signalSource = trap(signal: configuration.lifecycle.stopSignal) { signal in
108109
logger.info("intercepted signal: \(signal)")
109110
lifecycle.shutdown()
110111
}
112+
#endif
111113

112114
lifecycle.start().flatMap {
113115
lifecycle.shutdownFuture
114116
}.whenComplete { lifecycleResult in
117+
#if DEBUG
115118
signalSource.cancel()
119+
#endif
116120
eventLoop.shutdownGracefully { error in
117121
if let error = error {
118122
preconditionFailure("Failed to shutdown eventloop: \(error)")

0 commit comments

Comments
 (0)