Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Christian Merten
haskell-gargantext
Commits
ce533895
Commit
ce533895
authored
Jul 22, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[nodeStory] some more config repo path refactoring
parent
74911135
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
Tools.hs
src/Gargantext/API/Ngrams/Tools.hs
+2
-4
NodeStoryFile.hs
src/Gargantext/Core/NodeStoryFile.hs
+7
-5
No files found.
src/Gargantext/API/Ngrams/Tools.hs
View file @
ce533895
...
@@ -23,10 +23,9 @@ import Data.Set (Set)
...
@@ -23,10 +23,9 @@ import Data.Set (Set)
import
Data.Validity
import
Data.Validity
import
Gargantext.API.Ngrams.Types
import
Gargantext.API.Ngrams.Types
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
NodeType
(
..
),
ListId
)
import
Gargantext.Core.Types
(
ListType
(
..
),
NodeId
,
NodeType
(
..
),
ListId
)
import
Gargantext.Database.Prelude
(
CmdM
,
HasConnectionPool
(
..
)
,
hasConfig
)
import
Gargantext.Database.Prelude
(
CmdM
,
HasConnectionPool
(
..
))
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
)
import
Gargantext.Database.Schema.Ngrams
(
NgramsType
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
gc_repofilepath
)
import
qualified
Data.HashMap.Strict
as
HM
import
qualified
Data.HashMap.Strict
as
HM
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Map.Strict
as
Map
import
qualified
Data.Set
as
Set
import
qualified
Data.Set
as
Set
...
@@ -205,8 +204,7 @@ migrateFromDirToDb = do
...
@@ -205,8 +204,7 @@ migrateFromDirToDb = do
pool
<-
view
connPool
pool
<-
view
connPool
listIds
<-
liftBase
$
getNodesIdWithType
pool
NodeList
listIds
<-
liftBase
$
getNodesIdWithType
pool
NodeList
printDebug
"[migrateFromDirToDb] listIds"
listIds
printDebug
"[migrateFromDirToDb] listIds"
listIds
repoFP
<-
view
$
hasConfig
.
gc_repofilepath
(
NodeStory
nls
)
<-
NSF
.
getRepoReadConfig
listIds
(
NodeStory
nls
)
<-
NSF
.
getRepoNoEnv
repoFP
listIds
printDebug
"[migrateFromDirToDb] nls"
nls
printDebug
"[migrateFromDirToDb] nls"
nls
_
<-
mapM
(
\
(
nId
,
a
)
->
do
_
<-
mapM
(
\
(
nId
,
a
)
->
do
n
<-
liftBase
$
nodeExists
pool
nId
n
<-
liftBase
$
nodeExists
pool
nId
...
...
src/Gargantext/Core/NodeStoryFile.hs
View file @
ce533895
...
@@ -12,8 +12,9 @@ import Control.Concurrent (MVar(), modifyMVar_, newMVar, readMVar, withMVar)
...
@@ -12,8 +12,9 @@ import Control.Concurrent (MVar(), modifyMVar_, newMVar, readMVar, withMVar)
import
Control.Debounce
(
mkDebounce
,
defaultDebounceSettings
,
debounceFreq
,
debounceAction
)
import
Control.Debounce
(
mkDebounce
,
defaultDebounceSettings
,
debounceFreq
,
debounceAction
)
import
Gargantext.Core.NodeStory
hiding
(
readNodeStoryEnv
)
import
Gargantext.Core.NodeStory
hiding
(
readNodeStoryEnv
)
import
Gargantext.Core.Types
(
ListId
,
NodeId
(
..
))
import
Gargantext.Core.Types
(
ListId
,
NodeId
(
..
))
import
Gargantext.Database.Prelude
(
CmdM
)
import
Gargantext.Database.Prelude
(
CmdM
,
hasConfig
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
gc_repofilepath
)
import
System.Directory
(
renameFile
,
createDirectoryIfMissing
,
doesFileExist
,
removeFile
)
import
System.Directory
(
renameFile
,
createDirectoryIfMissing
,
doesFileExist
,
removeFile
)
import
System.IO
(
FilePath
,
hClose
)
import
System.IO
(
FilePath
,
hClose
)
import
System.IO.Temp
(
withTempFile
)
import
System.IO.Temp
(
withTempFile
)
...
@@ -34,10 +35,11 @@ getRepo listIds = do
...
@@ -34,10 +35,11 @@ getRepo listIds = do
-- v' <- liftBase $ readMVar v
-- v' <- liftBase $ readMVar v
-- pure $ v'
-- pure $ v'
getRepoNoEnv
::
(
CmdM
env
err
m
)
getRepoReadConfig
::
(
CmdM
env
err
m
)
=>
NodeStoryDir
->
[
ListId
]
->
m
NodeListStory
=>
[
ListId
]
->
m
NodeListStory
getRepoNoEnv
dir
listIds
=
do
getRepoReadConfig
listIds
=
do
env
<-
liftBase
$
readNodeStoryEnv
dir
repoFP
<-
view
$
hasConfig
.
gc_repofilepath
env
<-
liftBase
$
readNodeStoryEnv
repoFP
let
g
=
view
nse_getter
env
let
g
=
view
nse_getter
env
liftBase
$
do
liftBase
$
do
v
<-
g
listIds
v
<-
g
listIds
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment