mirror of https://github.com/voidlizard/hbs2
wip, busyloop removed? maybe leak
This commit is contained in:
parent
025b269562
commit
b7e5fcdbe3
|
@ -9,6 +9,8 @@ constraints:
|
|||
, suckless-conf >= 0.1.2.7
|
||||
, http-client >=0.7.16 && <0.8
|
||||
|
||||
|
||||
debug-info: True
|
||||
-- executable-static: True
|
||||
-- profiling: True
|
||||
--library-profiling: False
|
||||
|
|
|
@ -243,20 +243,20 @@ runMessagingTCP env@MessagingTCP{..} = liftIO do
|
|||
S.yield =<< ( readTVarIO _tcpSent <&> ("tcpSent",) . fromIntegral . HM.size)
|
||||
|
||||
sweepCookies <- ContT $ withAsync $ forever do
|
||||
pause @'Seconds 10
|
||||
atomically do
|
||||
pips <- readTVar _tcpPeerConn
|
||||
modifyTVar _tcpPeerToCookie (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||
alive <- readTVar _tcpPeerToCookie <&> HS.fromList . HM.elems
|
||||
modifyTVar _tcpPeerCookie (HM.filterWithKey (\k _ -> HS.member k alive))
|
||||
pause @'Seconds 120
|
||||
-- atomically do
|
||||
-- pips <- readTVar _tcpPeerConn
|
||||
-- modifyTVar _tcpPeerToCookie (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||
-- alive <- readTVar _tcpPeerToCookie <&> HS.fromList . HM.elems
|
||||
-- modifyTVar _tcpPeerCookie (HM.filterWithKey (\k _ -> HS.member k alive))
|
||||
|
||||
sweep <- ContT $ withAsync $ forever do
|
||||
pause @'Seconds 60
|
||||
atomically do
|
||||
pips <- readTVar _tcpPeerConn
|
||||
modifyTVar _tcpSent (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||
modifyTVar _tcpPeerSocket (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||
modifyTVar _tcpPeerCookie (HM.filter (>=1))
|
||||
pause @'Seconds 120
|
||||
-- atomically do
|
||||
-- pips <- readTVar _tcpPeerConn
|
||||
-- modifyTVar _tcpSent (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||
-- modifyTVar _tcpPeerSocket (HM.filterWithKey (\k _ -> HM.member k pips))
|
||||
-- modifyTVar _tcpPeerCookie (HM.filter (>=1))
|
||||
|
||||
waitAnyCatchCancel [p1,p2,probes,sweep,sweepCookies]
|
||||
|
||||
|
|
Loading…
Reference in New Issue