move externalConfig into ExternalState
Groundwork to having multiple processes running at once for an external special remote; each needs its own externalConfig.
This commit is contained in:
parent
63e21a607f
commit
b69dea0ac3
2 changed files with 29 additions and 20 deletions
7
Remote/External/Types.hs
vendored
7
Remote/External/Types.hs
vendored
|
@ -52,8 +52,7 @@ data External = External
|
|||
, externalState :: TMVar ExternalState
|
||||
-- Empty when a remote is in use.
|
||||
, externalLock :: TMVar ExternalLock
|
||||
-- Never left empty.
|
||||
, externalConfig :: TMVar RemoteConfig
|
||||
, externalDefaultConfig :: RemoteConfig
|
||||
, externalGitConfig :: RemoteGitConfig
|
||||
}
|
||||
|
||||
|
@ -63,7 +62,7 @@ newExternal externaltype u c gc = liftIO $ External
|
|||
<*> pure u
|
||||
<*> atomically newEmptyTMVar
|
||||
<*> atomically (newTMVar ExternalLock)
|
||||
<*> atomically (newTMVar c)
|
||||
<*> pure c
|
||||
<*> pure gc
|
||||
|
||||
type ExternalType = String
|
||||
|
@ -73,6 +72,8 @@ data ExternalState = ExternalState
|
|||
, externalReceive :: Handle
|
||||
, externalShutdown :: IO ()
|
||||
, externalPrepared :: PrepareStatus
|
||||
-- Never left empty.
|
||||
, externalConfig :: TMVar RemoteConfig
|
||||
}
|
||||
|
||||
data PrepareStatus = Unprepared | Prepared | FailedPrepare ErrorMsg
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue