Skip to content

Commit

Permalink
Fix: Random Crash tonisuter#9
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Scuderi committed Aug 4, 2019
1 parent 3f7d56a commit 8f07caf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Examples/SquareNumber/Sources/SquareNumber/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ func squareNumber(input: Input, context: Context) -> Output {
let squaredNumber = input.number * input.number
return Output(result: squaredNumber)
}

let runtime = try Runtime()
runtime.registerLambda("squareNumber", handlerFunction: squareNumber)
try runtime.start()
do {
let runtime = try Runtime()
runtime.registerLambda("squareNumber", handlerFunction: squareNumber)
try runtime.start()
} catch (let error) {
log(error)
}
7 changes: 6 additions & 1 deletion Sources/AWSLambdaSwift/Runtime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ public class Runtime {
var handlers: [String: Handler]

public init() throws {
self.urlSession = URLSession(configuration: .default)

let configuration = URLSessionConfiguration.default
configuration.timeoutIntervalForRequest = 3600


self.urlSession = URLSession(configuration: configuration)
self.handlers = [:]

let environment = ProcessInfo.processInfo.environment
Expand Down

0 comments on commit 8f07caf

Please sign in to comment.