Skip to content

Commit df07734

Browse files
authored
Merge pull request #26 from theam/fix-timeout
Fix timeout
2 parents 458ebbd + 637d41e commit df07734

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

default.nix

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{ compiler ? "ghc863", pkgs ? import <nixpkgs> {} }:
2+
3+
let
4+
5+
haskellPackages = pkgs.haskell.packages.${compiler}.extend ( self: super: {
6+
});
7+
8+
runtime = haskellPackages.callCabal2nix "aws-lambda-haskell-runtime" ./. {};
9+
10+
in
11+
{
12+
aws-lambda-haskell-runtime = runtime;
13+
aws-lambda-haskell-runtime-shell = haskellPackages.shellFor {
14+
packages = p: [runtime];
15+
buildInputs = with pkgs; [
16+
cabal-install
17+
hlint
18+
stack
19+
haskellPackages.ghcid
20+
haskellPackages.weeder
21+
zlib
22+
];
23+
};
24+
}

package.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: aws-lambda-haskell-runtime
2-
version: 1.0.9
2+
version: 1.0.10
33
github: "theam/aws-lambda-haskell-runtime"
44
license: Apache-2.0
55
author: Nikita Tchayka
@@ -26,6 +26,7 @@ library:
2626
- conduit
2727
- directory
2828
- filepath
29+
- http-client
2930
- microlens-platform
3031
- optparse-generic
3132
- process

shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(import ./. {}).aws-lambda-haskell-runtime-shell

src/Aws/Lambda/Runtime.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import Data.Monoid ((<>))
2020
import qualified Data.CaseInsensitive as CI
2121
import Lens.Micro.Platform hiding ((.=))
2222
import qualified Network.Wreq as Wreq
23+
import qualified Network.HTTP.Client as Http
2324
import qualified System.Environment as Environment
2425
import qualified System.Process as Process
2526
import qualified Data.UUID as UUID
@@ -132,8 +133,10 @@ readFunctionMemory = do
132133

133134
getApiData :: Text -> App (Wreq.Response LByteString)
134135
getApiData endpoint =
135-
keepRetrying (Wreq.get $ nextInvocationEndpoint endpoint)
136+
keepRetrying (Wreq.getWith opts $ nextInvocationEndpoint endpoint)
136137
where
138+
opts = Wreq.defaults
139+
& Wreq.manager .~ Left (Http.defaultManagerSettings { Http.managerResponseTimeout = Http.responseTimeoutNone })
137140
keepRetrying :: IO (Wreq.Response LByteString) -> App (Wreq.Response LByteString)
138141
keepRetrying f = do
139142
result <- (liftIO $ try f) :: App (Either IOException (Wreq.Response LByteString))

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
# resolver: ./custom-snapshot.yaml
1919
# resolver: https://example.com/snapshots/2018-01-01.yaml
20-
resolver: lts-12.13
20+
resolver: lts-13.0
2121

2222
# User packages to be built.
2323
# Various formats can be used as shown in the example below.

0 commit comments

Comments
 (0)