Commit b8852dea authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[corpus new] add info about current doc id

This is for debugging purposes for the Prelude.read error.
parent 3e3510ae
...@@ -52,7 +52,7 @@ import qualified Gargantext.Core.Text.Corpus.API as API ...@@ -52,7 +52,7 @@ import qualified Gargantext.Core.Text.Corpus.API as API
import qualified Gargantext.Core.Text.Corpus.Parsers as Parser (FileFormat(..), parseFormat) import qualified Gargantext.Core.Text.Corpus.Parsers as Parser (FileFormat(..), parseFormat)
import Gargantext.Core.Types.Individu (User(..)) import Gargantext.Core.Types.Individu (User(..))
import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger) import Gargantext.Core.Utils.Prefix (unPrefix, unPrefixSwagger)
import Gargantext.Database.Action.Flow (flowCorpus, getDataText, flowDataText, TermType(..){-, allDataOrigins-}) import Gargantext.Database.Action.Flow (flowCorpus, getDataText, flowDataText, DataText(..), TermType(..){-, allDataOrigins-})
import Gargantext.Database.Action.Flow.Types (FlowCmdM) import Gargantext.Database.Action.Flow.Types (FlowCmdM)
import Gargantext.Database.Action.Mail (sendMail) import Gargantext.Database.Action.Mail (sendMail)
import Gargantext.Database.Action.Node (mkNodeWithParent) import Gargantext.Database.Action.Node (mkNodeWithParent)
...@@ -221,13 +221,19 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q ...@@ -221,13 +221,19 @@ addToCorpusWithQuery user cid (WithQuery { _wq_query = q
[] -> do [] -> do
let txts = rights eTxts let txts = rights eTxts
-- TODO Sum lenghts of each txt elements -- TODO Sum lenghts of each txt elements
logStatus JobLog { _scst_succeeded = Just 2 let jl = JobLog { _scst_succeeded = Just 2
, _scst_failed = Just 0 , _scst_failed = Just 0
, _scst_remaining = Just $ 1 + length txts , _scst_remaining = Just $ 1 + length txts
, _scst_events = Just [] , _scst_events = Just []
} }
logStatus jl
cids <- mapM (\txt -> flowDataText user txt (Multi l) cid Nothing logStatus) txts
cids <- mapM (\txt -> do
let id = case txt of
(DataNew (i, _)) -> i
_ -> (Just 0)
logStatus $ addEvent "INFO: doc id" (T.pack $ show id) jl
flowDataText user txt (Multi l) cid Nothing logStatus) txts
printDebug "corpus id" cids printDebug "corpus id" cids
printDebug "sending email" ("xxxxxxxxxxxxxxxxxxxxx" :: Text) printDebug "sending email" ("xxxxxxxxxxxxxxxxxxxxx" :: Text)
sendMail user sendMail user
......
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