diff --git a/src/Handler/Health.hs b/src/Handler/Health.hs index 8cc60de6d..ed31be102 100644 --- a/src/Handler/Health.hs +++ b/src/Handler/Health.hs @@ -102,20 +102,27 @@ getInstanceR = do -- Most simple page for simple liveness checks getStatusR :: Handler Html getStatusR = do - currtime <- show <$> liftIO getCurrentTime - withUrlRenderer + currtime <- liftIO getCurrentTime + withUrlRenderer [hamlet| $doctype 5
-- Current Time {#{currtime}} + Current Time #{show currtime}
- Compile Time {#{comptime}} + Compile Time #{show comptime} + $maybe ctime <- readMay comptime +
+ Build is #{show $ ddays ctime currtime} days old |] where - -- vnr_full :: Text = $(embedStringFile "nix/docker/version.json") -- nix/ files not accessible on build server - comptime :: Text = $(stringE =<< runIO (show <$> getCurrentTime)) - \ No newline at end of file + -- vnr_full :: Text = $(embedStringFile "nix/docker/version.json") -- nix/ files not accessible during container construction + + comptime :: Text + comptime = $(stringE =<< runIO (show <$> getCurrentTime)) + + ddays :: UTCTime -> UTCTime -> Double + ddays tstart tstop = (/10) $ fromIntegral $ round $ diffUTCTime tstop tstart / (6 * 60 * 24)