aboutsummaryrefslogtreecommitdiff
path: root/src/executable/haskell/Service
diff options
context:
space:
mode:
authorJoris2019-09-05 21:48:06 +0200
committerJoris2019-09-05 21:48:06 +0200
commit91419f240b788339c202e0d35ef1df3cae64216b (patch)
tree99da65a72dee71e993d30ff967fa60c4b3fa0c04 /src/executable/haskell/Service
parent317e7b1e7319182e5caa5169119aea9fc8d660b6 (diff)
Add noise to sleep duration
Diffstat (limited to 'src/executable/haskell/Service')
-rw-r--r--src/executable/haskell/Service/AdListener.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/executable/haskell/Service/AdListener.hs b/src/executable/haskell/Service/AdListener.hs
index 9af92f4..5b4d634 100644
--- a/src/executable/haskell/Service/AdListener.hs
+++ b/src/executable/haskell/Service/AdListener.hs
@@ -71,9 +71,10 @@ sleepUntilReady conf = do
Just d -> do
sleepSeconds d
- Nothing ->
- -- TODO 04/09/2019: Add noise
- sleepSeconds . Conf.listenInterval $ conf
+ Nothing -> do
+ duration <- TimeUtils.addNoise (Conf.listenInterval conf) (Conf.listenIntervalNoise conf)
+ putStrLn . show $ duration
+ sleepSeconds duration
where
sleepSeconds =
threadDelay . (*) 1000000 . round