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
159
Issues
159
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
a4185c58
Verified
Commit
a4185c58
authored
Nov 15, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[README] info about worker config
parent
611fcb17
Pipeline
#6976
passed with stages
in 55 minutes and 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
7 deletions
+41
-7
README.md
README.md
+41
-7
No files found.
README.md
View file @
a4185c58
...
@@ -402,13 +402,8 @@ allows for scaling.
...
@@ -402,13 +402,8 @@ allows for scaling.
To run the worker, follow these steps:
To run the worker, follow these steps:
-
start a PostgreSQL DB, usually the one with Gargantext DB is enough
-
start a PostgreSQL DB, usually the one with Gargantext DB is enough
-
`"simple"`
worker definition is in
`gargantext-settings.toml`
-
`"default"`
worker definition is in
`gargantext-settings.toml_toModify`
-
run worker:
`cabal v2-run gargantext-cli -- worker --name simple`
-
run worker:
`cabal v2-run gargantext-cli -- worker --name default`
When running the worker for the first time (or sending a job), best
attempt is made to ensure the DB exists (if not, we will try to create
it) and the
`pgmq`
schema is initialized. This allows for hassle-free
maintenance and easier onboarding.
The project that we base our worker is
The project that we base our worker is
[
haskell-bee
](
https://gitlab.iscpif.fr/gargantext/haskell-bee/
)
. It's
[
haskell-bee
](
https://gitlab.iscpif.fr/gargantext/haskell-bee/
)
. It's
...
@@ -416,6 +411,45 @@ a more generic framework for managing asynchronous workers, supporting
...
@@ -416,6 +411,45 @@ a more generic framework for managing asynchronous workers, supporting
different brokers. Here, we decided to use
`pgmq`
because we already
different brokers. Here, we decided to use
`pgmq`
because we already
have PostgreSQL deployed.
have PostgreSQL deployed.
## Configuration
Edit your
`gargantext-settings.toml`
file and add this section:
```
toml
[worker]
# After this number of seconds, the job will be available again.
# You can set timeout for each job individually and this is the
# preferred method over using defaultVt.
default_visibility_timeout
=
1
# default delay before job is visible to the worker
default_delay
=
0
[worker.database]
host
=
"127.0.0.1"
port
=
5432
name
=
"pgmq"
user
=
"gargantua"
pass
=
PASSWORD_TO_CHANGE
[[worker.definitions]]
name
=
"default"
queue
=
"default"
```
When running the worker for the first time (or sending a job), best
attempt is made to ensure the DB exists (if not, we will try to create
it) and the
`pgmq`
schema is initialized. This allows for hassle-free
maintenance and easier onboarding.
The way this is done is that we use the gargantext DB credentials as a
pivot to create the worker DB. This works of course if both DBs are on
the same server (
`host`
and
`port`
for both definitions must agree)
and the garg DB user can create new DBs. If they're on different
server, it is just assumed that the
`worker.database`
from above
config exists. See
`G.C.W.Broker`
->
`initBrokerWithDBCreate`
for more
details.
## Design
## Design
Thanks to the fact that we already use
`Servant.Jobs`
(which executes
Thanks to the fact that we already use
`Servant.Jobs`
(which executes
...
...
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