moved ThreadedMonad to Types

This commit is contained in:
Joey Hess 2012-10-29 19:07:10 -04:00
parent d05083bb18
commit 86cb3faf51
7 changed files with 8 additions and 15 deletions

View file

@ -15,7 +15,6 @@ import Assistant.Sync
import Assistant.WebApp
import Assistant.WebApp.Types
import Assistant.WebApp.SideBar
import Assistant.ThreadedMonad
import Utility.Yesod
import qualified Remote.S3 as S3
import Logs.Remote
@ -116,11 +115,9 @@ getEnableS3R uuid = s3Configurator $ do
makeS3Remote :: S3Creds -> String -> (Remote -> Handler ()) -> RemoteConfig -> Handler ()
makeS3Remote (S3Creds ak sk) name setup config = do
d <- getAssistantY id
let st = threadState d
remotename <- runAnnex name $ fromRepo $ uniqueRemoteName name 0
liftIO $ S3.s3SetCredsEnv ( T.unpack ak, T.unpack sk)
r <- liftIO $ runThreadState st $ addRemote $ do
r <- runAssistantY $ liftAnnex $ addRemote $ do
makeSpecialRemote name S3.remote config
return remotename
setup r

View file

@ -11,7 +11,6 @@ import Assistant.Common
import Assistant.WebApp
import Assistant.WebApp.Types
import Assistant.DaemonStatus
import Assistant.ThreadedMonad
import Assistant.TransferQueue
import Assistant.TransferSlots
import Assistant.Sync
@ -38,8 +37,7 @@ changeSyncable (Just r) False = do
changeSyncFlag r False
d <- getAssistantY id
let dstatus = daemonStatusHandle d
let st = threadState d
liftIO $ runThreadState st $ updateSyncRemotes dstatus
runAssistantY $ liftAnnex $ updateSyncRemotes dstatus
{- Stop all transfers to or from this remote.
- XXX Can't stop any ongoing scan, or git syncs. -}
void $ liftIO $ dequeueTransfers (transferQueue d) dstatus tofrom