remove unnecessary mvar
This commit is contained in:
parent
7373866968
commit
63e21a607f
2 changed files with 4 additions and 5 deletions
|
@ -242,13 +242,13 @@ handleRequest' lck external req mp responsehandler
|
||||||
send $ VALUE value
|
send $ VALUE value
|
||||||
handleRemoteRequest (SETCREDS setting login password) = do
|
handleRemoteRequest (SETCREDS setting login password) = do
|
||||||
c <- liftIO $ atomically $ readTMVar $ externalConfig external
|
c <- liftIO $ atomically $ readTMVar $ externalConfig external
|
||||||
gc <- liftIO $ atomically $ readTMVar $ externalGitConfig external
|
let gc = externalGitConfig external
|
||||||
c' <- setRemoteCredPair encryptionAlreadySetup c gc (credstorage setting) $
|
c' <- setRemoteCredPair encryptionAlreadySetup c gc (credstorage setting) $
|
||||||
Just (login, password)
|
Just (login, password)
|
||||||
void $ liftIO $ atomically $ swapTMVar (externalConfig external) c'
|
void $ liftIO $ atomically $ swapTMVar (externalConfig external) c'
|
||||||
handleRemoteRequest (GETCREDS setting) = do
|
handleRemoteRequest (GETCREDS setting) = do
|
||||||
c <- liftIO $ atomically $ readTMVar $ externalConfig external
|
c <- liftIO $ atomically $ readTMVar $ externalConfig external
|
||||||
gc <- liftIO $ atomically $ readTMVar $ externalGitConfig external
|
let gc = externalGitConfig external
|
||||||
creds <- fromMaybe ("", "") <$>
|
creds <- fromMaybe ("", "") <$>
|
||||||
getRemoteCredPair c gc (credstorage setting)
|
getRemoteCredPair c gc (credstorage setting)
|
||||||
send $ CREDS (fst creds) (snd creds)
|
send $ CREDS (fst creds) (snd creds)
|
||||||
|
|
5
Remote/External/Types.hs
vendored
5
Remote/External/Types.hs
vendored
|
@ -54,8 +54,7 @@ data External = External
|
||||||
, externalLock :: TMVar ExternalLock
|
, externalLock :: TMVar ExternalLock
|
||||||
-- Never left empty.
|
-- Never left empty.
|
||||||
, externalConfig :: TMVar RemoteConfig
|
, externalConfig :: TMVar RemoteConfig
|
||||||
-- Never left empty.
|
, externalGitConfig :: RemoteGitConfig
|
||||||
, externalGitConfig :: TMVar RemoteGitConfig
|
|
||||||
}
|
}
|
||||||
|
|
||||||
newExternal :: ExternalType -> UUID -> RemoteConfig -> RemoteGitConfig -> Annex External
|
newExternal :: ExternalType -> UUID -> RemoteConfig -> RemoteGitConfig -> Annex External
|
||||||
|
@ -65,7 +64,7 @@ newExternal externaltype u c gc = liftIO $ External
|
||||||
<*> atomically newEmptyTMVar
|
<*> atomically newEmptyTMVar
|
||||||
<*> atomically (newTMVar ExternalLock)
|
<*> atomically (newTMVar ExternalLock)
|
||||||
<*> atomically (newTMVar c)
|
<*> atomically (newTMVar c)
|
||||||
<*> atomically (newTMVar gc)
|
<*> pure gc
|
||||||
|
|
||||||
type ExternalType = String
|
type ExternalType = String
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue