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
150
Issues
150
List
Board
Labels
Milestones
Merge Requests
5
Merge Requests
5
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
gargantext
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
Pipeline
#3049
failed with stage
in 57 minutes and 30 seconds
Changes
2
Pipelines
1
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)
import
Data.Validity
import
Gargantext.API.Ngrams.Types
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.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
...
...
@@ -205,8 +204,7 @@ migrateFromDirToDb = do
pool
<-
view
connPool
listIds
<-
liftBase
$
getNodesIdWithType
pool
NodeList
printDebug
"[migrateFromDirToDb] listIds"
listIds
repoFP
<-
view
$
hasConfig
.
gc_repofilepath
(
NodeStory
nls
)
<-
NSF
.
getRepoNoEnv
repoFP
listIds
(
NodeStory
nls
)
<-
NSF
.
getRepoReadConfig
listIds
printDebug
"[migrateFromDirToDb] nls"
nls
_
<-
mapM
(
\
(
nId
,
a
)
->
do
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)
import
Control.Debounce
(
mkDebounce
,
defaultDebounceSettings
,
debounceFreq
,
debounceAction
)
import
Gargantext.Core.NodeStory
hiding
(
readNodeStoryEnv
)
import
Gargantext.Core.Types
(
ListId
,
NodeId
(
..
))
import
Gargantext.Database.Prelude
(
CmdM
)
import
Gargantext.Database.Prelude
(
CmdM
,
hasConfig
)
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
(
gc_repofilepath
)
import
System.Directory
(
renameFile
,
createDirectoryIfMissing
,
doesFileExist
,
removeFile
)
import
System.IO
(
FilePath
,
hClose
)
import
System.IO.Temp
(
withTempFile
)
...
...
@@ -34,10 +35,11 @@ getRepo listIds = do
-- v' <- liftBase $ readMVar v
-- pure $ v'
getRepoNoEnv
::
(
CmdM
env
err
m
)
=>
NodeStoryDir
->
[
ListId
]
->
m
NodeListStory
getRepoNoEnv
dir
listIds
=
do
env
<-
liftBase
$
readNodeStoryEnv
dir
getRepoReadConfig
::
(
CmdM
env
err
m
)
=>
[
ListId
]
->
m
NodeListStory
getRepoReadConfig
listIds
=
do
repoFP
<-
view
$
hasConfig
.
gc_repofilepath
env
<-
liftBase
$
readNodeStoryEnv
repoFP
let
g
=
view
nse_getter
env
liftBase
$
do
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