Commit 74911135 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[nodeStory] migration script gets repo filepath from env

parent e892077f
{-|
{-|
Module : Gargantext.API.Admin.Settings
Description : Settings of the API (Server and Client)
Copyright : (c) CNRS, 2017-Present
......
......@@ -23,9 +23,10 @@ import Data.Set (Set)
import Data.Validity
import Gargantext.API.Ngrams.Types
import Gargantext.Core.Types (ListType(..), NodeId, NodeType(..), ListId)
import Gargantext.Database.Prelude (CmdM, HasConnectionPool(..))
import Gargantext.Database.Prelude (CmdM, HasConnectionPool(..), hasConfig)
import Gargantext.Database.Schema.Ngrams (NgramsType)
import Gargantext.Prelude
import Gargantext.Prelude.Config (gc_repofilepath)
import qualified Data.HashMap.Strict as HM
import qualified Data.Map.Strict as Map
import qualified Data.Set as Set
......@@ -199,12 +200,13 @@ getCoocByNgrams' f (Diagonal diag) m =
migrateFromDirToDb :: (CmdM env err m, HasNodeStory env err m)
=> NSF.NodeStoryDir -> m ()
migrateFromDirToDb dir = do
=> m ()
migrateFromDirToDb = do
pool <- view connPool
listIds <- liftBase $ getNodesIdWithType pool NodeList
printDebug "[migrateFromDirToDb] listIds" listIds
(NodeStory nls) <- NSF.getRepoNoEnv dir listIds
repoFP <- view $ hasConfig . gc_repofilepath
(NodeStory nls) <- NSF.getRepoNoEnv repoFP listIds
printDebug "[migrateFromDirToDb] nls" nls
_ <- mapM (\(nId, a) -> do
n <- liftBase $ nodeExists pool nId
......
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