summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2022-07-18 15:50:36 -0400
committerJoey Hess <joeyh@joeyh.name>2022-07-18 16:39:19 -0400
commit36f0bdcd574738d53574104168054ae33d20d8ba (patch)
tree5067bde3b2ae04de0402d9bc26e3ddc91b86d909 /Logs
parentccff6396518e4e117783c21afcf0dc00a5ec30f1 (diff)
add annex.alwayscompact
Added annex.alwayscompact setting which can be unset to speed up writes to the git-annex branch in some cases. Sponsored-by: Dartmouth College's DANDI project
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Web.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Logs/Web.hs b/Logs/Web.hs
index a84fc1cc76..cce855f105 100644
--- a/Logs/Web.hs
+++ b/Logs/Web.hs
@@ -57,7 +57,11 @@ getUrlsWithPrefix key prefix = filter (prefix `isPrefixOf`)
setUrlPresent :: Key -> URLString -> Annex ()
setUrlPresent key url = do
- us <- getUrls key
+ -- Avoid reading the url log when not compacting, for speed.
+ us <- ifM (annexAlwaysCompact <$> Annex.getGitConfig)
+ ( getUrls key
+ , pure mempty
+ )
unless (url `elem` us) $ do
config <- Annex.getGitConfig
addLog (Annex.Branch.RegardingUUID []) (urlLogFile config key)