From d1f722e3b0b74a9d9a2e35ac1f47dbca9f7cf606 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Sep 2016 15:49:44 -0400 Subject: better locking for json with -J Avoid threads emitting json at the same time and scrambling, which was still possible even with the buffering, just less likely. Converted json IO actions to JSONChunk data too. --- Messages/Progress.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Messages/Progress.hs') diff --git a/Messages/Progress.hs b/Messages/Progress.hs index a48e7b07e..39709a211 100644 --- a/Messages/Progress.hs +++ b/Messages/Progress.hs @@ -11,7 +11,6 @@ module Messages.Progress where import Common import Messages -import Messages.Internal import Utility.Metered import Types import Types.Messages @@ -59,7 +58,7 @@ metered othermeter key a = case keySize key of #endif go _ (MessageState { outputType = JSONOutput False }) = nometer go size (MessageState { outputType = JSONOutput True }) = do - buf <- withMessageState $ return . showJSONBuffer + buf <- withMessageState $ return . jsonBuffer m <- liftIO $ rateLimitMeterUpdate 0.1 (Just size) $ JSON.progress buf size a (combinemeter m) @@ -93,7 +92,7 @@ concurrentMeteredFile file combinemeterupdate key a = {- Progress dots. -} showProgressDots :: Annex () -showProgressDots = outputMessage q "." +showProgressDots = outputMessage JSON.none "." {- Runs a command, that may output progress to either stdout or - stderr, as well as other messages. -- cgit v1.2.3