...to avoid stateful collectors that are not queried regularly accumulating thunks.
Signed-off-by: Klaus Aehlig <[email protected]> --- src/Ganeti/Monitoring/Server.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Ganeti/Monitoring/Server.hs b/src/Ganeti/Monitoring/Server.hs index 2f34cee..def1e72 100644 --- a/src/Ganeti/Monitoring/Server.hs +++ b/src/Ganeti/Monitoring/Server.hs @@ -41,6 +41,7 @@ module Ganeti.Monitoring.Server ) where import Control.Applicative +import Control.DeepSeq (force) import Control.Monad import Control.Monad.IO.Class import Data.ByteString.Char8 hiding (map, filter, find) @@ -251,7 +252,7 @@ collect m collector = let name = dName collector existing = Map.lookup name m new_data <- update existing - return $ Map.insert name new_data m + return $ Map.insert name (force new_data) m -- | Invokes collect for each data collector. collection :: CollectorMap -> IO CollectorMap -- 2.2.0.rc0.207.ga3a616c
