Fix supervisor and proper rate limiting
This commit is contained in:
@@ -16,7 +16,7 @@ module HomeAssistant.Runtime.Graphing
|
||||
|
||||
import Control.Exception (evaluate)
|
||||
import Control.Monad (forever)
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
import Control.Monad.IO.Class (liftIO, MonadIO)
|
||||
import qualified Data.ByteString as BS
|
||||
import qualified Data.ByteString.Lazy as BL
|
||||
import Data.Text (Text)
|
||||
@@ -155,9 +155,9 @@ handler rrdPath rrdtool = do
|
||||
app :: FilePath -> FilePath -> ScottyM ()
|
||||
app rrdPath rrdtool = get "/metrics/:name" (handler rrdPath rrdtool)
|
||||
|
||||
graphAction :: FilePath -> FilePath -> Int -> IO Void
|
||||
graphAction rrdPath rrdtool port = forever $ scottyOpts opts (app rrdPath rrdtool)
|
||||
graphAction :: MonadIO m => FilePath -> FilePath -> Int -> m Void
|
||||
graphAction rrdPath rrdtool port = liftIO $ forever $ scottyOpts opts (app rrdPath rrdtool)
|
||||
where
|
||||
opts = defaultOptions
|
||||
{ settings = setHost "127.0.0.1" (setPort port defaultSettings)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user