allow annex.expireunused to be set to false, as well as to a duration
This commit is contained in:
parent
ee5bb374bb
commit
489972c035
2 changed files with 5 additions and 3 deletions
|
@ -232,7 +232,8 @@ oneDay = 24 * oneHour
|
||||||
checkOldUnused :: UrlRenderer -> Assistant ()
|
checkOldUnused :: UrlRenderer -> Assistant ()
|
||||||
checkOldUnused urlrenderer = go =<< annexExpireUnused <$> liftAnnex Annex.getGitConfig
|
checkOldUnused urlrenderer = go =<< annexExpireUnused <$> liftAnnex Annex.getGitConfig
|
||||||
where
|
where
|
||||||
go (Just expireunused) = do
|
go (Just Nothing) = noop
|
||||||
|
go (Just (Just expireunused)) = do
|
||||||
m <- liftAnnex $ readUnusedLog ""
|
m <- liftAnnex $ readUnusedLog ""
|
||||||
now <- liftIO getPOSIXTime
|
now <- liftIO getPOSIXTime
|
||||||
let duration = durationToPOSIXTime expireunused
|
let duration = durationToPOSIXTime expireunused
|
||||||
|
|
|
@ -47,7 +47,7 @@ data GitConfig = GitConfig
|
||||||
, annexLargeFiles :: Maybe String
|
, annexLargeFiles :: Maybe String
|
||||||
, annexFsckNudge :: Bool
|
, annexFsckNudge :: Bool
|
||||||
, annexAutoUpgrade :: AutoUpgrade
|
, annexAutoUpgrade :: AutoUpgrade
|
||||||
, annexExpireUnused :: Maybe Duration
|
, annexExpireUnused :: Maybe (Maybe Duration)
|
||||||
, coreSymlinks :: Bool
|
, coreSymlinks :: Bool
|
||||||
, gcryptId :: Maybe String
|
, gcryptId :: Maybe String
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,8 @@ extractGitConfig r = GitConfig
|
||||||
, annexLargeFiles = getmaybe (annex "largefiles")
|
, annexLargeFiles = getmaybe (annex "largefiles")
|
||||||
, annexFsckNudge = getbool (annex "fscknudge") True
|
, annexFsckNudge = getbool (annex "fscknudge") True
|
||||||
, annexAutoUpgrade = toAutoUpgrade $ getmaybe (annex "autoupgrade")
|
, annexAutoUpgrade = toAutoUpgrade $ getmaybe (annex "autoupgrade")
|
||||||
, annexExpireUnused = parseDuration =<< getmaybe (annex "expireunused")
|
, annexExpireUnused = maybe Nothing Just . parseDuration
|
||||||
|
<$> getmaybe (annex "expireunused")
|
||||||
, coreSymlinks = getbool "core.symlinks" True
|
, coreSymlinks = getbool "core.symlinks" True
|
||||||
, gcryptId = getmaybe "core.gcrypt-id"
|
, gcryptId = getmaybe "core.gcrypt-id"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue