converting more log files to use Builder
Probably not any particular speedup in this, since most of these logs are not written to often. Possibly chunk log writing is sped up, but writes to chunk logs are interleaved with expensive data transfers to remotes, so unlikely to be a noticiable speedup.
This commit is contained in:
parent
5500cbbc30
commit
2d46038754
12 changed files with 91 additions and 56 deletions
|
@ -1,6 +1,6 @@
|
|||
{- Remote state logs.
|
||||
-
|
||||
- Copyright 2014 Joey Hess <id@joeyh.name>
|
||||
- Copyright 2014, 2019 Joey Hess <id@joeyh.name>
|
||||
-
|
||||
- Licensed under the GNU GPL version 3 or higher.
|
||||
-}
|
||||
|
@ -17,6 +17,7 @@ import qualified Annex.Branch
|
|||
import qualified Annex
|
||||
|
||||
import qualified Data.Map as M
|
||||
import Data.ByteString.Builder
|
||||
|
||||
type RemoteState = String
|
||||
|
||||
|
@ -25,7 +26,10 @@ setRemoteState u k s = do
|
|||
c <- liftIO currentVectorClock
|
||||
config <- Annex.getGitConfig
|
||||
Annex.Branch.change (remoteStateLogFile config k) $
|
||||
encodeBL . showLogNew id . changeLog c u s . parseLogNew Just . decodeBL
|
||||
buildRemoteState . changeLog c u s . parseLogNew Just . decodeBL
|
||||
|
||||
buildRemoteState :: Log RemoteState -> Builder
|
||||
buildRemoteState = buildLogNew (byteString . encodeBS)
|
||||
|
||||
getRemoteState :: UUID -> Key -> Annex (Maybe RemoteState)
|
||||
getRemoteState u k = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue