summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-02 15:20:03 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-02 15:20:03 -0400
commit6623a51cf9a5284d8fb9b883b499d8eb8a6381c8 (patch)
tree12d7050ce924b7dec00d01c01a5016bf6029b058
parente6f61e5ab90982668459b32a782d0b6287dc6aee (diff)
run sync in background
-rw-r--r--Assistant/WebApp/Configurators/Local.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs
index dd9923988..64bb25b28 100644
--- a/Assistant/WebApp/Configurators/Local.hs
+++ b/Assistant/WebApp/Configurators/Local.hs
@@ -37,6 +37,7 @@ import qualified Data.Text as T
import Data.Char
import System.Posix.Directory
import qualified Control.Exception as E
+import Control.Concurrent
data RepositoryPath = RepositoryPath Text
deriving Show
@@ -229,12 +230,12 @@ uniqueRemoteName r basename n
| n == 0 = basename
| otherwise = basename ++ show n
-{- Start syncing a newly added remote. -}
+{- Start syncing a newly added remote, using a background thread. -}
syncRemote :: Remote -> Handler ()
syncRemote remote = do
webapp <- getYesod
runAnnex () $ updateKnownRemotes (daemonStatus webapp)
- liftIO $ do
+ void $ liftIO $ forkIO $ do
reconnectRemotes "WebApp"
(fromJust $ threadState webapp)
(daemonStatus webapp)