diff options
author | Joey Hess <joey@kitenet.net> | 2012-10-29 16:49:47 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-10-29 16:49:47 -0400 |
commit | 2960a8011484fa3dad1cff55e8e412f4d4b1db84 (patch) | |
tree | c36b30274a014f5a7d22dd072a3756a9d4b817cc /Assistant/Threads/Pusher.hs | |
parent | 0864097c212131b477b41907b3d59dacf6bc4fe9 (diff) |
lift alertWhile
Diffstat (limited to 'Assistant/Threads/Pusher.hs')
-rw-r--r-- | Assistant/Threads/Pusher.hs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Assistant/Threads/Pusher.hs b/Assistant/Threads/Pusher.hs index 0235e6efc..95e4e1276 100644 --- a/Assistant/Threads/Pusher.hs +++ b/Assistant/Threads/Pusher.hs @@ -31,9 +31,8 @@ pushRetryThread = NamedThread "PushRetrier" $ runEvery (Seconds halfhour) <~> do topush <- liftIO $ getFailedPushesBefore pushmap (fromIntegral halfhour) unless (null topush) $ do debug ["retrying", show (length topush), "failed pushes"] - now <- liftIO $ getCurrentTime - dstatus <- getAssistant daemonStatusHandle - void $ alertWhile dstatus (pushRetryAlert topush) <~> + void $ alertWhile (pushRetryAlert topush) $ do + now <- liftIO $ getCurrentTime pushToRemotes now True topush where halfhour = 1800 @@ -48,10 +47,9 @@ pushThread = NamedThread "Pusher" $ runEvery (Seconds 2) <~> do if shouldPush commits then do remotes <- filter pushable . syncRemotes <$> daemonStatus - unless (null remotes) $ do - now <- liftIO $ getCurrentTime - dstatus <- getAssistant daemonStatusHandle - void $ alertWhile dstatus (pushAlert remotes) <~> + unless (null remotes) $ + void $ alertWhile (pushAlert remotes) $ do + now <- liftIO $ getCurrentTime pushToRemotes now True remotes else do debug ["delaying push of", show (length commits), "commits"] |