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
141
Issues
141
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
2467fb40
Commit
2467fb40
authored
May 26, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[OPTIM][FIX] serialise/deserialise without encode/decode json
parent
84e3f3f0
Pipeline
#861
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
Settings.hs
src/Gargantext/API/Admin/Settings.hs
+5
-5
No files found.
src/Gargantext/API/Admin/Settings.hs
View file @
2467fb40
...
...
@@ -26,14 +26,13 @@ TODO-SECURITY: Critical
module
Gargantext.API.Admin.Settings
where
import
Codec.Serialise
(
Serialise
(),
serialise
)
import
Codec.Serialise
(
Serialise
(),
serialise
,
deserialise
)
import
Control.Concurrent
import
Control.Debounce
(
mkDebounce
,
defaultDebounceSettings
,
debounceFreq
,
debounceAction
)
import
Control.Exception
(
finally
)
import
Control.Lens
import
Control.Monad.Logger
import
Control.Monad.Reader
import
Data.Aeson
hiding
(
encode
)
import
Data.ByteString
(
ByteString
)
import
Data.Either
(
either
)
import
Data.Maybe
(
fromMaybe
)
...
...
@@ -191,7 +190,7 @@ repoSnapshot = repoDir <> "/repo.json"
repoSaverAction
::
Serialise
a
=>
a
->
IO
()
repoSaverAction
a
=
do
withTempFile
"repos"
"tmp-repo.json"
$
\
fp
h
->
do
--
printDebug "repoSaverAction" fp
printDebug
"repoSaverAction"
fp
L
.
hPut
h
$
serialise
a
hClose
h
renameFile
fp
repoSnapshot
...
...
@@ -230,8 +229,9 @@ readRepoEnv = do
mvar
<-
newMVar
=<<
if
repoExists
then
do
e_repo
<-
eitherDecodeFileStrict
repoSnapshot
repo
<-
either
fail
pure
e_repo
-- e_repo <- eitherDecodeStrict <$> deserialise <$> L.readFile repoSnapshot
repo
<-
deserialise
<$>
L
.
readFile
repoSnapshot
-- repo <- either fail pure e_repo
let
archive
=
repoSnapshot
<>
".v"
<>
show
(
repo
^.
r_version
)
copyFile
repoSnapshot
archive
pure
repo
...
...
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