summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Pusher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-24 17:16:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-24 17:16:04 -0400
commitd265917659b09e30d7ad0db345621b9b06288274 (patch)
treefae1418bcb47c0b1a9897b1c25935e4db6ce9a26 /Assistant/Threads/Pusher.hs
parent9467d2bb7289c0769c1837c92595789c88301a84 (diff)
remove last use of TSet
Diffstat (limited to 'Assistant/Threads/Pusher.hs')
-rw-r--r--Assistant/Threads/Pusher.hs19
1 files changed, 2 insertions, 17 deletions
diff --git a/Assistant/Threads/Pusher.hs b/Assistant/Threads/Pusher.hs
index e90cca1ec..57595b8c1 100644
--- a/Assistant/Threads/Pusher.hs
+++ b/Assistant/Threads/Pusher.hs
@@ -33,13 +33,9 @@ pushThread :: NamedThread
pushThread = namedThread "Pusher" $ runEvery (Seconds 2) <~> do
-- We already waited two seconds as a simple rate limiter.
-- Next, wait until at least one commit has been made
- commits <- getCommits
+ void getCommits
-- Now see if now's a good time to push.
- if shouldPush commits
- then void $ pushToRemotes True =<< pushTargets
- else do
- debug ["delaying push of", show (length commits), "commits"]
- refillCommits commits
+ void $ pushToRemotes True =<< pushTargets
{- We want to avoid pushing to remotes that are marked readonly.
-
@@ -51,14 +47,3 @@ pushTargets = liftIO . filterM available =<< candidates <$> getDaemonStatus
where
candidates = filter (not . Remote.readonly) . syncGitRemotes
available = maybe (return True) doesDirectoryExist . Remote.localpath
-
-{- Decide if now is a good time to push to remotes.
- -
- - Current strategy: Immediately push all commits. The commit machinery
- - already determines batches of changes, so we can't easily determine
- - batches better.
- -}
-shouldPush :: [Commit] -> Bool
-shouldPush commits
- | not (null commits) = True
- | otherwise = False