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
158
Issues
158
List
Board
Labels
Milestones
Merge Requests
11
Merge Requests
11
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
8d3ac246
Commit
8d3ac246
authored
Apr 27, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN] split Prelude.Utils
parent
e55c38aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
10 deletions
+29
-10
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+1
-1
Clock.hs
src/Gargantext/Prelude/Clock.hs
+28
-0
Utils.hs
src/Gargantext/Prelude/Utils.hs
+0
-9
No files found.
src/Gargantext/API/Ngrams.hs
View file @
8d3ac246
...
...
@@ -118,7 +118,7 @@ import Gargantext.Database.Query.Table.Node.Select
import
Gargantext.Database.Schema.Node
(
node_id
,
node_parentId
,
node_userId
)
import
Gargantext.Prelude
hiding
(
log
)
import
Gargantext.Prelude.Job
import
Gargantext.Prelude.
Utils
(
hasTime
,
getTime
)
import
Gargantext.Prelude.
Clock
(
hasTime
,
getTime
)
import
Prelude
(
error
)
import
Servant
hiding
(
Patch
)
import
Servant.Job.Async
(
JobFunction
(
..
),
serveJobsAPI
)
...
...
src/Gargantext/Prelude/Clock.hs
0 → 100644
View file @
8d3ac246
{-|
Module : Gargantext.Prelude.Clock
Description : Useful Tools near Prelude of the project
Copyright : (c) CNRS, 2017-Present
License : AGPL + CECILL v3
Maintainer : team@gargantext.org
Stability : experimental
Portability : POSIX
-}
module
Gargantext.Prelude.Clock
where
import
Data.Aeson
(
ToJSON
,
toJSON
)
import
Formatting.Clock
(
timeSpecs
)
import
Formatting.Internal
(
Format
(
..
))
import
Gargantext.Prelude
import
qualified
System.Clock
as
Clock
(
getTime
,
TimeSpec
,
Clock
(
..
))
---------------------------------------------------------------------------------
getTime
::
MonadBase
IO
m
=>
m
Clock
.
TimeSpec
getTime
=
liftBase
$
Clock
.
getTime
Clock
.
ProcessCPUTime
hasTime
::
Formatting
.
Internal
.
Format
r
(
Clock
.
TimeSpec
->
Clock
.
TimeSpec
->
r
)
hasTime
=
timeSpecs
src/Gargantext/Prelude/Utils.hs
View file @
8d3ac246
...
...
@@ -23,8 +23,6 @@ import Control.Monad.Reader (MonadReader)
import
Data.Aeson
(
ToJSON
,
toJSON
)
import
Data.Text
(
Text
)
import
Data.Tuple.Extra
(
both
)
import
Formatting.Clock
(
timeSpecs
)
import
Formatting.Internal
(
Format
(
..
))
import
GHC.IO
(
FilePath
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
,
NodeType
)
import
Gargantext.Database.Prelude
(
HasConfig
(
..
))
...
...
@@ -35,16 +33,9 @@ import System.Directory (createDirectoryIfMissing)
import
System.IO.Error
import
System.Random
(
newStdGen
)
import
qualified
Data.Text
as
Text
import
qualified
System.Clock
as
Clock
(
getTime
,
TimeSpec
,
Clock
(
..
))
import
qualified
System.Directory
as
SD
import
qualified
System.Random.Shuffle
as
SRS
-------------------------------------------------------------------
hasTime
::
Formatting
.
Internal
.
Format
r
(
Clock
.
TimeSpec
->
Clock
.
TimeSpec
->
r
)
hasTime
=
timeSpecs
getTime
::
MonadBase
IO
m
=>
m
Clock
.
TimeSpec
getTime
=
liftBase
$
Clock
.
getTime
Clock
.
ProcessCPUTime
-------------------------------------------------------------------
-- | Main Class to use (just declare needed functions)
class
GargDB
a
where
...
...
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