chore(status): show build age in days
This commit is contained in:
parent
9a2c3611b3
commit
4846547f48
@ -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
|
||||
<html lang=en>
|
||||
<head>
|
||||
<title>Alive
|
||||
<title>Status
|
||||
<body>
|
||||
<p>
|
||||
Current Time {#{currtime}}
|
||||
Current Time #{show currtime}
|
||||
<p>
|
||||
Compile Time {#{comptime}}
|
||||
Compile Time #{show comptime}
|
||||
$maybe ctime <- readMay comptime
|
||||
<p>
|
||||
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))
|
||||
|
||||
-- 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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user