invalidate caches after log changes
This seems like something Annex.Sim would need to happen. And generally a really good idea.
This commit is contained in:
parent
f5f7b4a936
commit
a194e88a62
4 changed files with 10 additions and 2 deletions
|
@ -39,6 +39,7 @@ recordMaxSize uuid maxsize = do
|
||||||
(buildLogNew buildMaxSize)
|
(buildLogNew buildMaxSize)
|
||||||
. changeLog c uuid maxsize
|
. changeLog c uuid maxsize
|
||||||
. parseLogNew parseMaxSize
|
. parseLogNew parseMaxSize
|
||||||
|
Annex.changeState $ \s -> s { Annex.maxsizes = Nothing }
|
||||||
|
|
||||||
buildMaxSize :: MaxSize -> Builder
|
buildMaxSize :: MaxSize -> Builder
|
||||||
buildMaxSize (MaxSize n) = byteString (encodeBS (show n))
|
buildMaxSize (MaxSize n) = byteString (encodeBS (show n))
|
||||||
|
|
|
@ -36,12 +36,14 @@ setGlobalNumCopies new = do
|
||||||
curr <- getGlobalNumCopies
|
curr <- getGlobalNumCopies
|
||||||
when (curr /= Just new) $
|
when (curr /= Just new) $
|
||||||
setLog (Annex.Branch.RegardingUUID []) numcopiesLog new
|
setLog (Annex.Branch.RegardingUUID []) numcopiesLog new
|
||||||
|
Annex.changeState $ \s -> s { Annex.globalnumcopies = Nothing }
|
||||||
|
|
||||||
setGlobalMinCopies :: MinCopies -> Annex ()
|
setGlobalMinCopies :: MinCopies -> Annex ()
|
||||||
setGlobalMinCopies new = do
|
setGlobalMinCopies new = do
|
||||||
curr <- getGlobalMinCopies
|
curr <- getGlobalMinCopies
|
||||||
when (curr /= Just new) $
|
when (curr /= Just new) $
|
||||||
setLog (Annex.Branch.RegardingUUID []) mincopiesLog new
|
setLog (Annex.Branch.RegardingUUID []) mincopiesLog new
|
||||||
|
Annex.changeState $ \s -> s { Annex.globalmincopies = Nothing }
|
||||||
|
|
||||||
{- Value configured in the numcopies log. Cached for speed. -}
|
{- Value configured in the numcopies log. Cached for speed. -}
|
||||||
getGlobalNumCopies :: Annex (Maybe NumCopies)
|
getGlobalNumCopies :: Annex (Maybe NumCopies)
|
||||||
|
|
|
@ -23,10 +23,14 @@ import Data.ByteString.Builder
|
||||||
|
|
||||||
{- Changes the preferred content configuration of a remote. -}
|
{- Changes the preferred content configuration of a remote. -}
|
||||||
preferredContentSet :: UUID -> PreferredContentExpression -> Annex ()
|
preferredContentSet :: UUID -> PreferredContentExpression -> Annex ()
|
||||||
preferredContentSet = setLog preferredContentLog
|
preferredContentSet u expr = do
|
||||||
|
setLog preferredContentLog u expr
|
||||||
|
Annex.changeState $ \st -> st { Annex.preferredcontentmap = Nothing }
|
||||||
|
|
||||||
requiredContentSet :: UUID -> PreferredContentExpression -> Annex ()
|
requiredContentSet :: UUID -> PreferredContentExpression -> Annex ()
|
||||||
requiredContentSet = setLog requiredContentLog
|
requiredContentSet u expr = do
|
||||||
|
setLog requiredContentLog u expr
|
||||||
|
Annex.changeState $ \st -> st { Annex.requiredcontentmap = Nothing }
|
||||||
|
|
||||||
setLog :: RawFilePath -> UUID -> PreferredContentExpression -> Annex ()
|
setLog :: RawFilePath -> UUID -> PreferredContentExpression -> Annex ()
|
||||||
setLog logfile uuid@(UUID _) val = do
|
setLog logfile uuid@(UUID _) val = do
|
||||||
|
|
|
@ -39,6 +39,7 @@ describeUUID uuid desc = do
|
||||||
c <- currentVectorClock
|
c <- currentVectorClock
|
||||||
Annex.Branch.change (Annex.Branch.RegardingUUID [uuid]) uuidLog $
|
Annex.Branch.change (Annex.Branch.RegardingUUID [uuid]) uuidLog $
|
||||||
buildLogOld builder . changeLog c uuid desc . parseUUIDLog
|
buildLogOld builder . changeLog c uuid desc . parseUUIDLog
|
||||||
|
Annex.changeState $ \s -> s { Annex.uuiddescmap = Nothing }
|
||||||
where
|
where
|
||||||
builder (UUIDDesc b) = byteString (escnewline b)
|
builder (UUIDDesc b) = byteString (escnewline b)
|
||||||
-- Escape any newline in the description, since newlines cannot
|
-- Escape any newline in the description, since newlines cannot
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue