Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
haskell-gargantext
haskell-gargantext
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 166
    • Issues 166
    • 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
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-gargantexthaskell-gargantext
  • Merge Requests
  • !153

Merged
Opened May 15, 2023 by Alfredo Di Napoli@AlfredoDiNapoli
  • Report abuse
Report abuse

Bind periodic actions to the main loop

Fixes the issue @anoe was having with the scheduled action to refresh the ngrams context table view.

I have done a bit of refactoring and moved everything around the main server loop, where we have an "allocator" function that schedules all the periodic actions and now the stopGargantext function will also kill all of the threads when we stop the server. Hopefully this is a pattern we can follow also for other async actions, whenever we need them.

I have tested this locally (with some debug putStrLn) and it seems to be doing the trick.

Two observations:

  1. We should probably get into the habit of using the LoggerSet we have as part of the Env and use that to emit logs, rather than just naively using putStrLn. But for the sake of this MR, I have simply followed the existing pattern;

  2. The DB functions like mkCmd or execPGSQuery seems to be over monomorphic -- they seems to make use only of a DB connection but they impose a constraint over a Cmd, which in turn requires "heavier" things like HasMain or HasNPLServer which are perhaps not necessary. Again, fixing this is out of the scope of this MR.

@anoe I'm happy to open issues for 1. and 2..

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b adinapoli/fix-scheduler origin/adinapoli/fix-scheduler

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/dev
git merge --no-ff adinapoli/fix-scheduler

Step 4. Push the result of the merge to GitLab

git push origin dev

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 0
  • Commits 1
  • Pipelines 1
  • Changes 5
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: gargantext/haskell-gargantext!153

Revert this commit

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this commit

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.