fix todo
This commit is contained in:
parent
bc509143e5
commit
554b7b7f3e
2 changed files with 9 additions and 5 deletions
|
@ -23,6 +23,7 @@ import Annex.LockFile
|
|||
import Config
|
||||
import Git.Types (fromRef)
|
||||
import Logs.Export
|
||||
import Logs.ContentIdentifier (recordContentIdentifier)
|
||||
|
||||
import qualified Data.Map as M
|
||||
import Control.Concurrent.STM
|
||||
|
@ -132,9 +133,9 @@ adjustExportImport r = case M.lookup "exporttree" (config r) of
|
|||
lcklckv <- liftIO newEmptyTMVarIO
|
||||
dbtv <- liftIO newEmptyTMVarIO
|
||||
let store f k loc p = do
|
||||
-- Only open the database once it's needed, since
|
||||
-- we have to take an exclusive write lock.
|
||||
-- The write lock will remain held while the
|
||||
-- Only open the database once it's needed,
|
||||
-- and take an exclusive write lock.
|
||||
-- The write lock will then remain held while the
|
||||
-- process is running.
|
||||
db <- liftIO (atomically (tryReadTMVar dbtv)) >>= \case
|
||||
Just (db, _lck) -> return db
|
||||
|
@ -159,7 +160,7 @@ adjustExportImport r = case M.lookup "exporttree" (config r) of
|
|||
Nothing -> return False
|
||||
Just newcid -> do
|
||||
liftIO $ ContentIdentifier.recordContentIdentifier db (uuid r') newcid k
|
||||
-- TODO update git-annex branch
|
||||
recordContentIdentifier (uuid r') newcid k
|
||||
return True
|
||||
|
||||
return $ r'
|
||||
|
|
|
@ -13,7 +13,10 @@ this.
|
|||
* Should the ContentIdentifier db be multiwriter? It would simplify
|
||||
the situation with the long-lived lock of it in adjustExportImport
|
||||
|
||||
* fix TODO in adjustExportImport
|
||||
OTOH, if a single process, such as the assistant, exported one tree,
|
||||
and then another, multiwriter would mean no guarantee that reading
|
||||
from the contentidentifier database would see values that were earlier
|
||||
written by the same process.
|
||||
|
||||
* Test export to importtree=yes remote and make sure it uses
|
||||
storeExportWithContentIdentifier correctly.
|
||||
|
|
Loading…
Reference in a new issue