every :: Int -> String -> IO Int -> IO ()
every secs sched act = do
    note' $ "Starting scheduling; runs are scheduled for every " ++ sched
    go
  where
    go = do
      info' "Starting new run..."
      tot <- act
      info' $ "Run completed! " ++ show tot ++ " items accepted."
      delaySecs secs >> go

-- | Execute a pipeline from Source to Sink, and return the total number of
--   elements processed as well as the total number accepted.
every :: Int -> String -> IO Int -> IO ()
every secs sched act = do
    note' $ "Starting scheduling; runs are scheduled for every " ++ sched
    go
  where
    go = do
      info' "Starting new run..."
      tot <- act
      info' $ "Run completed! " ++ show tot ++ " items accepted."
      delaySecs secs >> go

-- | Execute a pipeline from Source to Sink, and return the total number of
--   elements processed as well as the total number accepted.
every secs sched act = do
    note' $ "Starting scheduling; runs are scheduled for every " ++ sched
    go
  where
    go = do
      info' "Starting new run..."
      tot <- act
      info' $ "Run completed! " ++ show tot ++ " items accepted."
      delaySecs secs >> go

-- | Execute a pipeline from Source to Sink, and return the total number of
--   elements processed as well as the total number accepted.