diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-05-10 14:45:55 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-05-10 15:21:35 -0400 |
commit | ea506b28110d0e23210fb788b16ffe3deb92f23b (patch) | |
tree | e75cd9cbf7e45375f0619a97d2ffb62af3fe31ef /Assistant | |
parent | 0c7caf1e92eda1dde83b9fa95da5fc304ae2767d (diff) |
support time-1.5.0
This no longer uses old-locale's defaultTimeLocale, but provides one
of its own.
Factored out a Logs.TimeStamp.
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/DaemonStatus.hs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/Assistant/DaemonStatus.hs b/Assistant/DaemonStatus.hs index 1ed40595e..4c42ffdbe 100644 --- a/Assistant/DaemonStatus.hs +++ b/Assistant/DaemonStatus.hs @@ -16,6 +16,7 @@ import Assistant.Types.NetMessager import Utility.NotificationBroadcaster import Logs.Transfer import Logs.Trust +import Logs.TimeStamp import qualified Remote import qualified Types.Remote as Remote import qualified Git @@ -23,8 +24,6 @@ import qualified Git import Control.Concurrent.STM import System.Posix.Types import Data.Time.Clock.POSIX -import Data.Time -import System.Locale import qualified Data.Map as M import qualified Data.Set as S import qualified Data.Text as T @@ -125,21 +124,18 @@ readDaemonStatusFile file = parse <$> newDaemonStatus <*> readFile file where parse status = foldr parseline status . lines parseline line status - | key == "lastRunning" = parseval readtime $ \v -> + | key == "lastRunning" = parseval parsePOSIXTime $ \v -> status { lastRunning = Just v } | key == "scanComplete" = parseval readish $ \v -> status { scanComplete = v } | key == "sanityCheckRunning" = parseval readish $ \v -> status { sanityCheckRunning = v } - | key == "lastSanityCheck" = parseval readtime $ \v -> + | key == "lastSanityCheck" = parseval parsePOSIXTime $ \v -> status { lastSanityCheck = Just v } | otherwise = status -- unparsable line where (key, value) = separate (== ':') line parseval parser a = maybe status a (parser value) - readtime s = do - d <- parseTime defaultTimeLocale "%s%Qs" s - Just $ utcTimeToPOSIXSeconds d {- Checks if a time stamp was made after the daemon was lastRunning. - |