summaryrefslogtreecommitdiff
path: root/Announcer.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-17 16:23:19 -0400
committerjoe <joe@jerkface.net>2018-06-17 16:24:12 -0400
commitbf49988d6d1852892ed6ce874c4e5937e51ba5d1 (patch)
treefac54f0f7a2faede01e848956da2aa706e98e94d /Announcer.hs
parent114b7e4424de69dc5544fe93ca4c7df6a7618f0a (diff)
Announcer: Removed dead code (SearchFinished case).
Diffstat (limited to 'Announcer.hs')
-rw-r--r--Announcer.hs13
1 files changed, 3 insertions, 10 deletions
diff --git a/Announcer.hs b/Announcer.hs
index 0a731efa..9558e3eb 100644
--- a/Announcer.hs
+++ b/Announcer.hs
@@ -58,7 +58,6 @@ unpackAnnounceKey _ (AnnounceKey bs) = return $ Char8.unpack bs
58data ScheduledItem 58data ScheduledItem
59 = DeleteAnnouncement 59 = DeleteAnnouncement
60 | NewAnnouncement (STM (IO ())) (IO ()) (IO ()) POSIXTime 60 | NewAnnouncement (STM (IO ())) (IO ()) (IO ()) POSIXTime
61 | SearchFinished (IO ()) (IO ()) POSIXTime
62 | Announce (STM (IO ())) (IO ()) POSIXTime 61 | Announce (STM (IO ())) (IO ()) POSIXTime
63 | SearchResult (STM (IO ())) 62 | SearchResult (STM (IO ()))
64 | StopAnnouncer 63 | StopAnnouncer
@@ -73,10 +72,9 @@ data ScheduledItem
73itemStatusNum :: ScheduledItem -> Int 72itemStatusNum :: ScheduledItem -> Int
74itemStatusNum (DeleteAnnouncement ) = 0 73itemStatusNum (DeleteAnnouncement ) = 0
75itemStatusNum (NewAnnouncement {}) = 1 74itemStatusNum (NewAnnouncement {}) = 1
76itemStatusNum (SearchFinished {}) = 2 75itemStatusNum (Announce {}) = 2
77itemStatusNum (Announce {}) = 3 76itemStatusNum (SearchResult {}) = 3
78itemStatusNum (SearchResult {}) = 4 77itemStatusNum (StopAnnouncer ) = 4
79itemStatusNum (StopAnnouncer ) = 5
80itemStatusNum _ = error "itemStatusNum not in sync with ScheduledItem declaration." 78itemStatusNum _ = error "itemStatusNum not in sync with ScheduledItem declaration."
81 79
82data Announcer = Announcer 80data Announcer = Announcer
@@ -294,11 +292,6 @@ performScheduledItem announcer now = \case
294 hPutStrLn stderr $ "This print avoids negative-time future scheduling. Weird bug. TODO: fix it. "++show now 292 hPutStrLn stderr $ "This print avoids negative-time future scheduling. Weird bug. TODO: fix it. "++show now
295 announce 293 announce
296 294
297 -- search finished:
298 -- if any of the current storing-nodes set have not been
299 -- announced to, announce to them.
300 (Binding _ (SearchFinished {- st -} search announce interval) _) -> return $ Just $ return ()
301
302 (Binding _ (SearchResult action) _) -> Just <$> action 295 (Binding _ (SearchResult action) _) -> Just <$> action
303 296
304 297