Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
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
Przemyslaw Kaminski
haskell-gargantext
Commits
ff6e2e1e
Commit
ff6e2e1e
authored
Dec 19, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] Ngrams repo missing directory.
parent
6890ae68
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Settings.hs
src/Gargantext/API/Settings.hs
+9
-3
No files found.
src/Gargantext/API/Settings.hs
View file @
ff6e2e1e
...
...
@@ -178,14 +178,18 @@ data MockEnv = MockEnv
makeLenses
''
M
ockEnv
-- | TODO add this path in Settings
repoDir
::
FilePath
repoDir
=
"repos"
repoSnapshot
::
FilePath
repoSnapshot
=
"
repo.json"
repoSnapshot
=
repoDir
<>
"/
repo.json"
-- | TODO add hard coded file in Settings
-- This assumes we own the lock on repoSnapshot.
repoSaverAction
::
ToJSON
a
=>
a
->
IO
()
repoSaverAction
a
=
do
withTempFile
"
.
"
"tmp-repo.json"
$
\
fp
h
->
do
withTempFile
"
repos
"
"tmp-repo.json"
$
\
fp
h
->
do
-- printDebug "repoSaverAction" fp
L
.
hPut
h
$
encode
a
hClose
h
...
...
@@ -210,6 +214,8 @@ mkRepoSaver repo_var = mkDebounce settings
readRepoEnv
::
IO
RepoEnv
readRepoEnv
=
do
-- Does file exist ? :: Bool
_repoDir
<-
doesDirectoryExist
True
repoDir
repoFile
<-
doesFileExist
repoSnapshot
-- Is file not empty ? :: Bool
...
...
@@ -230,7 +236,7 @@ readRepoEnv = do
pure
repo
else
pure
initRepo
-- TODO save in DB here
saver
<-
mkRepoSaver
mvar
pure
$
RepoEnv
{
_renv_var
=
mvar
,
_renv_saver
=
saver
,
_renv_lock
=
lock
}
...
...
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