diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-06 17:54:45 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-06 17:54:45 -0400 |
commit | a46af901a455cb8bc3e7bdbebc13f796596a8207 (patch) | |
tree | d64660f83c2c7cfeb7aa930c3fa081bf3a9fdd42 /Assistant/Threads | |
parent | 3d8651e53108c8b9c85a217c788e4643e09695a4 (diff) |
avoid false alert about syncing with xmpp remote
Diffstat (limited to 'Assistant/Threads')
-rw-r--r-- | Assistant/Threads/Pusher.hs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/Assistant/Threads/Pusher.hs b/Assistant/Threads/Pusher.hs index a444a8530..8a695316e 100644 --- a/Assistant/Threads/Pusher.hs +++ b/Assistant/Threads/Pusher.hs @@ -17,8 +17,6 @@ import Assistant.Sync import Utility.ThreadScheduler import qualified Types.Remote as Remote -import Data.Time.Clock - {- This thread retries pushes that failed before. -} pushRetryThread :: NamedThread pushRetryThread = namedThread "PushRetrier" $ runEvery (Seconds halfhour) <~> do @@ -27,9 +25,8 @@ pushRetryThread = namedThread "PushRetrier" $ runEvery (Seconds halfhour) <~> do topush <- getFailedPushesBefore (fromIntegral halfhour) unless (null topush) $ do debug ["retrying", show (length topush), "failed pushes"] - void $ alertWhile (pushRetryAlert topush) $ do - now <- liftIO $ getCurrentTime - pushToRemotes now True topush + void $ alertWhile (pushRetryAlert topush) $ + pushToRemotes True topush where halfhour = 1800 @@ -41,13 +38,9 @@ pushThread = namedThread "Pusher" $ runEvery (Seconds 2) <~> do commits <- getCommits -- Now see if now's a good time to push. if shouldPush commits - then do - remotes <- filter (not . Remote.readonly) - . syncGitRemotes <$> getDaemonStatus - unless (null remotes) $ - void $ alertWhile (pushAlert remotes) $ do - now <- liftIO $ getCurrentTime - pushToRemotes now True remotes + then void $ pushToRemotes True + =<< filter (not . Remote.readonly) . syncGitRemotes + <$> getDaemonStatus else do debug ["delaying push of", show (length commits), "commits"] refillCommits commits |