Skip to content

Commit 577a2f0

Browse files
committed
It seems that without the notifySession being open in the middleware, the runtime detects the waiting on the MVar as an infinite wait. Which although true, it's useful to relay read messages and the connection will be closed by warp when the client disconects.
This should fix [#105]
1 parent 8027c0f commit 577a2f0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/PostgresWebsockets/Middleware.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ wsApp Context {..} pendingConn =
111111
when (hasWrite mode) $
112112
notifySession conn sendNotification chs
113113

114-
waitForever <- newEmptyMVar
115-
void $ takeMVar waitForever
114+
void $ forever $ threadDelay maxBound
116115

117116
-- Having both channel and claims as parameters seem redundant
118117
-- But it allows the function to ignore the claims structure and the source

0 commit comments

Comments
 (0)