alarmclock 0.2.0.8 → 0.2.0.9
raw patch · 2 files changed
+5/−6 lines, 2 filesnew-component:exe:test
Files
alarmclock.cabal view
@@ -1,5 +1,5 @@ name: alarmclock-version: 0.2.0.8+version: 0.2.0.9 synopsis: Wake up and perform an action at a certain time. description: Wake up and perform an action at a certain time. homepage: https://bitbucket.org/davecturner/alarmclock@@ -23,8 +23,7 @@ default-language: Haskell2010 ghc-options: -Wall -test-suite test- type: exitcode-stdio-1.0+executable test main-is: Main.hs hs-source-dirs: test default-language: Haskell2010
src/Control/Concurrent/AlarmClock.hs view
@@ -137,7 +137,7 @@ currentTime <- getCurrentTime let dt = ceiling $ (1000000 *) $ diffUTCTime wakeUpTime currentTime safeTimeout dt readNextSetting >>= \case- Nothing -> actAndContinue currentTime+ Nothing -> actAndContinue Just newSetting -> go newSetting -- Times out immediately if the duration is nonpositive (unlike 'timeout' which waits forever)@@ -145,7 +145,7 @@ | dt > 0 = timeout dt action | otherwise = return Nothing - actAndContinue currentTime = do+ actAndContinue = do atomically $ writeTVar acIsSet False- wakeUpAction currentTime+ wakeUpAction =<< getCurrentTime loop