diff options
author | Andrew Cady <d@jerkface.net> | 2018-06-18 07:12:13 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2018-06-18 07:12:13 -0400 |
commit | 0e4cf7e622d2e5b2af6a3707e08f0fac45cd6bb4 (patch) | |
tree | 9ea90cb6466f242f16ee6cc73c9b17a4a1ff7726 /Announcer/Tox.hs | |
parent | 19364a287f7083fc60beed2d6eae3dd71d27e737 (diff) |
avoid exposing PSQ
Diffstat (limited to 'Announcer/Tox.hs')
-rw-r--r-- | Announcer/Tox.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Announcer/Tox.hs b/Announcer/Tox.hs index c9164d22..03cd0871 100644 --- a/Announcer/Tox.hs +++ b/Announcer/Tox.hs | |||
@@ -91,8 +91,7 @@ newAnnouncement :: STM (IO a) | |||
91 | -> POSIXTime | 91 | -> POSIXTime |
92 | -> STM (IO ()) | 92 | -> STM (IO ()) |
93 | newAnnouncement checkFin search announce interval = \announcer k now -> do | 93 | newAnnouncement checkFin search announce interval = \announcer k now -> do |
94 | modifyTVar (scheduled announcer) | 94 | scheduleAbs announcer k (ScheduledItem $ reAnnounce checkFin announce interval) (now + interval) |
95 | (PSQ.insert' k (ScheduledItem $ reAnnounce checkFin announce interval) (now + interval)) | ||
96 | return $ void $ fork search | 95 | return $ void $ fork search |
97 | 96 | ||
98 | -- time for periodic announce: | 97 | -- time for periodic announce: |
@@ -107,8 +106,7 @@ reAnnounce :: STM (IO a) | |||
107 | -> STM (IO ()) | 106 | -> STM (IO ()) |
108 | reAnnounce checkFin announce interval = \announcer k now -> do | 107 | reAnnounce checkFin announce interval = \announcer k now -> do |
109 | isfin <- checkFin | 108 | isfin <- checkFin |
110 | modifyTVar (scheduled announcer) | 109 | scheduleAbs announcer k (ScheduledItem $ reAnnounce checkFin announce interval) (now + interval) |
111 | (PSQ.insert' k (ScheduledItem $ reAnnounce checkFin announce interval) (now + interval)) | ||
112 | return $ do | 110 | return $ do |
113 | isfin | 111 | isfin |
114 | hPutStrLn stderr $ "This print avoids negative-time future scheduling. Weird bug. TODO: fix it. "++show now | 112 | hPutStrLn stderr $ "This print avoids negative-time future scheduling. Weird bug. TODO: fix it. "++show now |