Skip to content

Commit ced8d92

Browse files
committed
Upgrade & bugfix
1 parent 16d097e commit ced8d92

File tree

9 files changed

+14
-56
lines changed

9 files changed

+14
-56
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-22.04",
66
"features": {
77
"ghcr.io/devcontainers-contrib/features/haskell:2": {
8-
"ghcVersion": "9.2.7",
8+
"ghcVersion": "9.4.8",
99
"installHLS": true,
1010
"installStack": true,
1111
"installStackGHCupHook": true,

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# builder
2-
FROM fpco/stack-build-small:lts-20.21 as base
2+
FROM fpco/stack-build-small:lts-21.25 as base
33

44
ARG DEBIAN_FRONTEND=noninteractive
55

src/Conduit/Api/User.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ updateUserHandler user (UserData user') = do
6565
else throwIO err400
6666
where
6767
newName = maybe (userName user) Username (uurUsername user')
68-
newEmail = maybe (userEmail user) EmailAddress (uurUsername user')
68+
newEmail = maybe (userEmail user) EmailAddress (uurEmail user')
6969
newPassword = Password <$> uurPassword user'
7070
newBio = fromMaybe (userBio user) (uurBio user')
7171
newImage = fromMaybe (userImage user) (uurImage user')

src/Conduit/Db/Transaction.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Conduit.App
44
import Conduit.Config
55
import Conduit.Environment
66
import Data.List
7+
import Data.Time.Clock (secondsToDiffTime, DiffTime)
78
import Hasql.Connection (Connection)
89
import Hasql.Pool (Pool, UsageError (..), acquire)
910
import qualified Hasql.Pool as Pool
@@ -13,8 +14,14 @@ import Hasql.Transaction (Transaction, condemn, sql, statement)
1314
import qualified Hasql.Transaction.Sessions as Hasql
1415
import RIO
1516

17+
connectionAcquisitionTimeout :: DiffTime
18+
connectionAcquisitionTimeout = secondsToDiffTime 10 -- 10 seconds
19+
20+
maximalConnectionLifetime :: DiffTime
21+
maximalConnectionLifetime = secondsToDiffTime 1800 -- 30 minutes
22+
1623
loadPool :: ByteString -> Int -> IO Pool
17-
loadPool connectString poolSize = acquire poolSize (Just 10) connectString
24+
loadPool connectString poolSize = acquire poolSize connectionAcquisitionTimeout maximalConnectionLifetime connectString
1825

1926
runTransactionWithConnection :: MonadIO m => Connection -> Transaction b -> m b
2027
runTransactionWithConnection conn transaction = do

stack-8.10.7.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

stack-9.0.2.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

stack-9.2.7.yaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

stack-9.4.4.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

stack.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
resolver: lts-20.21
1+
resolver: lts-21.25
22

33
packages:
44
- .
55

66
allow-newer: true
77

88
extra-deps:
9-
- unix-compat-0.7
9+
- jose-0.9
10+
- servant-auth-server-0.4.7.0

0 commit comments

Comments
 (0)