[ws] remove debug logs for centralexchange

parent 45eff945
...@@ -24,7 +24,7 @@ import Control.Concurrent.STM.TChan qualified as TChan ...@@ -24,7 +24,7 @@ import Control.Concurrent.STM.TChan qualified as TChan
import Data.Aeson qualified as Aeson import Data.Aeson qualified as Aeson
import Data.ByteString.Lazy qualified as BSL import Data.ByteString.Lazy qualified as BSL
import Data.Text qualified as T import Data.Text qualified as T
import Data.Text.Encoding qualified as TE -- import Data.Text.Encoding qualified as TE
import Gargantext.Core.AsyncUpdates.CentralExchange.Types import Gargantext.Core.AsyncUpdates.CentralExchange.Types
import Gargantext.Core.Config.Types (NotificationsConfig(..)) import Gargantext.Core.Config.Types (NotificationsConfig(..))
import Gargantext.Prelude import Gargantext.Prelude
...@@ -58,11 +58,11 @@ gServer (NotificationsConfig { .. }) = do ...@@ -58,11 +58,11 @@ gServer (NotificationsConfig { .. }) = do
-- | the 'tChan' and calls Dispatcher accordingly. This is to -- | the 'tChan' and calls Dispatcher accordingly. This is to
-- | make reading nanomsg as fast as possible. -- | make reading nanomsg as fast as possible.
void $ Async.concurrently (worker s_dispatcher tChan) $ do void $ Async.concurrently (worker s_dispatcher tChan) $ do
withLogger () $ \ioLogger -> do withLogger () $ \_ioLogger -> do
forever $ do forever $ do
-- putText "[central_exchange] receiving" -- putText "[central_exchange] receiving"
r <- recv s r <- recv s
logMsg ioLogger INFO $ "[central_exchange] received: " <> show r -- logMsg ioLogger DEBU $ "[central_exchange] received: " <> show r
-- C.putStrLn $ "[central_exchange] " <> r -- C.putStrLn $ "[central_exchange] " <> r
atomically $ TChan.writeTChan tChan r atomically $ TChan.writeTChan tChan r
where where
...@@ -75,8 +75,8 @@ gServer (NotificationsConfig { .. }) = do ...@@ -75,8 +75,8 @@ gServer (NotificationsConfig { .. }) = do
-- logMsg ioLogger DEBUG $ "[central_exchange] " <> show ujp -- logMsg ioLogger DEBUG $ "[central_exchange] " <> show ujp
-- send the same message that we received -- send the same message that we received
void $ sendNonblocking s_dispatcher r void $ sendNonblocking s_dispatcher r
Just (UpdateTreeFirstLevel node_id) -> do Just (UpdateTreeFirstLevel _node_id) -> do
logMsg ioLogger INFO $ "[central_exchange] update tree: " <> show node_id -- logMsg ioLogger DEBUG $ "[central_exchange] update tree: " <> show node_id
-- putText $ "[central_exchange] sending that to the dispatcher: " <> show node_id -- putText $ "[central_exchange] sending that to the dispatcher: " <> show node_id
-- To make this more robust, use withAsync so we don't -- To make this more robust, use withAsync so we don't
-- block the main thread (send is blocking) -- block the main thread (send is blocking)
...@@ -102,6 +102,6 @@ notify (NotificationsConfig { _nc_central_exchange_connect }) ceMessage = do ...@@ -102,6 +102,6 @@ notify (NotificationsConfig { _nc_central_exchange_connect }) ceMessage = do
withSocket Push $ \s -> do withSocket Push $ \s -> do
_ <- connect s $ T.unpack _nc_central_exchange_connect _ <- connect s $ T.unpack _nc_central_exchange_connect
let str = Aeson.encode ceMessage let str = Aeson.encode ceMessage
withLogger () $ \ioLogger -> -- withLogger () $ \ioLogger ->
logMsg ioLogger DEBUG $ "[central_exchange] sending: " <> (T.unpack $ TE.decodeUtf8 $ BSL.toStrict str) -- logMsg ioLogger DEBUG $ "[central_exchange] sending: " <> (T.unpack $ TE.decodeUtf8 $ BSL.toStrict str)
void $ sendNonblocking s $ BSL.toStrict str void $ sendNonblocking s $ BSL.toStrict str
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment