aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Threads/Pusher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-29 16:22:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-29 16:22:14 -0400
commit47f4506a1ed1d98d3bdae0de24e00f2eb64611da (patch)
tree384a5b97fb6710d19c4c26a43d6f364dedf4d4a3 /Assistant/Threads/Pusher.hs
parentf62e5c41e4621940a863b35c9c54e0626587a694 (diff)
lifted Assistant.Sync into Assistant monad
lots of nice cleanups
Diffstat (limited to 'Assistant/Threads/Pusher.hs')
-rw-r--r--Assistant/Threads/Pusher.hs13
1 files changed, 4 insertions, 9 deletions
diff --git a/Assistant/Threads/Pusher.hs b/Assistant/Threads/Pusher.hs
index 811314651..0235e6efc 100644
--- a/Assistant/Threads/Pusher.hs
+++ b/Assistant/Threads/Pusher.hs
@@ -32,11 +32,9 @@ pushRetryThread = NamedThread "PushRetrier" $ runEvery (Seconds halfhour) <~> do
unless (null topush) $ do
debug ["retrying", show (length topush), "failed pushes"]
now <- liftIO $ getCurrentTime
- st <- getAssistant threadState
- pushnotifier <- getAssistant pushNotifier
dstatus <- getAssistant daemonStatusHandle
- void $ liftIO $ alertWhile dstatus (pushRetryAlert topush) $
- pushToRemotes thisThread now st (Just pushnotifier) (Just pushmap) topush
+ void $ alertWhile dstatus (pushRetryAlert topush) <~>
+ pushToRemotes now True topush
where
halfhour = 1800
@@ -52,12 +50,9 @@ pushThread = NamedThread "Pusher" $ runEvery (Seconds 2) <~> do
remotes <- filter pushable . syncRemotes <$> daemonStatus
unless (null remotes) $ do
now <- liftIO $ getCurrentTime
- st <- getAssistant threadState
- pushmap <- getAssistant failedPushMap
- pushnotifier <- getAssistant pushNotifier
dstatus <- getAssistant daemonStatusHandle
- void $ liftIO $ alertWhile dstatus (pushAlert remotes) $
- pushToRemotes thisThread now st (Just pushnotifier) (Just pushmap) remotes
+ void $ alertWhile dstatus (pushAlert remotes) <~>
+ pushToRemotes now True remotes
else do
debug ["delaying push of", show (length commits), "commits"]
flip refillCommits commits <<~ commitChan