summaryrefslogtreecommitdiff
path: root/Limit.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Limit.hs')
-rw-r--r--Limit.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Limit.hs b/Limit.hs
index 71dbce168..f3586e029 100644
--- a/Limit.hs
+++ b/Limit.hs
@@ -27,6 +27,7 @@ import Types.TrustLevel
import Types.Key
import Types.Group
import Types.FileMatcher
+import Types.Limit
import Logs.Group
import Utility.HumanTime
import Utility.DataUnits
@@ -41,10 +42,6 @@ import Types.FileMatcher
#endif
#endif
-type MatchFiles = AssumeNotPresent -> FileInfo -> Annex Bool
-type MkLimit = String -> Either String MatchFiles
-type AssumeNotPresent = S.Set UUID
-
{- Checks if there are user-specified limits. -}
limited :: Annex Bool
limited = (not . Utility.Matcher.isEmpty) <$> getMatcher'
@@ -238,7 +235,8 @@ limitSize vs s = case readSize dataUnits s of
addTimeLimit :: String -> Annex ()
addTimeLimit s = do
- let seconds = fromMaybe (error "bad time-limit") $ parseDuration s
+ let seconds = maybe (error "bad time-limit") durationToPOSIXTime $
+ parseDuration s
start <- liftIO getPOSIXTime
let cutoff = start + seconds
addLimit $ Right $ const $ const $ do