summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Presence/Server.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Presence/Server.hs b/Presence/Server.hs
index da0cda17..c7162265 100644
--- a/Presence/Server.hs
+++ b/Presence/Server.hs
@@ -622,8 +622,13 @@ pingCancel me = do
622pingBump :: PingMachine -> IO () 622pingBump :: PingMachine -> IO ()
623pingBump me = do 623pingBump me = do
624 b <- atomically $ do 624 b <- atomically $ do
625 when (pingIdle me /= 0) $ 625 when (pingIdle me /= 0) $ do
626 putTMVar (pingDelay me) (1000*pingIdle me,PingIdle) 626 e <- tryReadTMVar (pingDelay me)
627 case e of
628 Just (0,PingTimeOut) -> return () -- canceled/fired
629 Just _ -> retry
630 Nothing -> putTMVar (pingDelay me)
631 (1000*pingIdle me,PingIdle)
627 readTVar (pingStarted me) 632 readTVar (pingStarted me)
628 when b $ throwTo (pingThread me) $ ErrorCall "" 633 when b $ throwTo (pingThread me) $ ErrorCall ""
629 634