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
|
-- Most simple page for simple liveness checks
|
||||||
getStatusR :: Handler Html
|
getStatusR :: Handler Html
|
||||||
getStatusR = do
|
getStatusR = do
|
||||||
currtime <- show <$> liftIO getCurrentTime
|
currtime <- liftIO getCurrentTime
|
||||||
withUrlRenderer
|
withUrlRenderer
|
||||||
[hamlet|
|
[hamlet|
|
||||||
$doctype 5
|
$doctype 5
|
||||||
<html lang=en>
|
<html lang=en>
|
||||||
<head>
|
<head>
|
||||||
<title>Alive
|
<title>Status
|
||||||
<body>
|
<body>
|
||||||
<p>
|
<p>
|
||||||
Current Time {#{currtime}}
|
Current Time #{show currtime}
|
||||||
<p>
|
<p>
|
||||||
Compile Time {#{comptime}}
|
Compile Time #{show comptime}
|
||||||
|
$maybe ctime <- readMay comptime
|
||||||
|
<p>
|
||||||
|
Build is #{show $ ddays ctime currtime} days old
|
||||||
|]
|
|]
|
||||||
where
|
where
|
||||||
-- vnr_full :: Text = $(embedStringFile "nix/docker/version.json") -- nix/ files not accessible on build server
|
-- vnr_full :: Text = $(embedStringFile "nix/docker/version.json") -- nix/ files not accessible during container construction
|
||||||
comptime :: Text = $(stringE =<< runIO (show <$> getCurrentTime))
|
|
||||||
|
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