summaryrefslogtreecommitdiffhomepage
path: root/Role/Downloader.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-26 16:15:43 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-26 16:18:01 -0400
commit52f9c68869fa8956db55980f0b36ba817f825ffb (patch)
treeb288b73ee5766a0048b1e2d593a0d0ec130044c0 /Role/Downloader.hs
parent62f7653e39e95d3e9cd308810e487e3cdee84d52 (diff)
downloaddebug-me-52f9c68869fa8956db55980f0b36ba817f825ffb.tar.gz
include elapsedTime in Activity
Time is relative, so the debug-me proof chain doesn't prove when things happened, but it's still useful to have some idea of how long things took to happen. This makes --replay work with logs gotten by --download. Log still includes loggedTimestamp. This is a bit redundant, and is unused now, but it's useful for log files to record when messages were received. This commit was sponsored by Riku Voipio.
Diffstat (limited to 'Role/Downloader.hs')
-rw-r--r--Role/Downloader.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Role/Downloader.hs b/Role/Downloader.hs
index 07148e8..243410b 100644
--- a/Role/Downloader.hs
+++ b/Role/Downloader.hs
@@ -4,10 +4,11 @@ import Types
import Log
import CmdLine
import SessionID
+import Role.Developer (run', processSessionStart, getServerMessage, Output(..))
import Control.Concurrent.STM
import Control.Concurrent.STM.TMChan
-import Role.Developer (run', processSessionStart, getServerMessage, Output(..))
+import Data.Time.Clock.POSIX
run :: DownloadOpts -> IO ()
run = run' downloader . downloadUrl
@@ -22,7 +23,8 @@ downloader _ichan ochan sid = do
go logger st
where
go logger st = do
- v <- atomically $ getServerMessage ochan st
+ ts <- getPOSIXTime
+ v <- atomically $ getServerMessage ochan st ts
case v of
Nothing -> return ()
Just (o, msg) -> do