dita-for-small-teams / dfst-linkmgmt-basex

Link management application implemented using the BaseX XQuery database
Apache License 2.0
3 stars 2 forks source link

Rest response post receive #5

Open drmacro opened 7 years ago

drmacro commented 7 years ago

Pull request for background update with pull from gitlab by link mgr.

drmacro commented 7 years ago

On the BaseX side the code will need two different forms of the path: one for storing into the BaseX database and one for pulling the content from GitLab. I think this means that the REST method needs to get two parameters: the base path of the file and the git-repo-specific URL to use to pull the file. That way the link manager can blindly resolve the pull URI.

drmacro commented 7 years ago

I'm also concerned that once the basex code is actually pulling the content from the git repo that this approach would end up blocking if the curl waits for a response from the basex server, but I'm not sure exactly how that works, but I would expect it to block.

It might make more sense to batch up the set of files to be pulled, pass that to the link manager, and then figure out how to pass the pull off to a separate thread inside basex so the REST method can return asap.

drmacro commented 7 years ago

See this part of the BaseX documentation:

http://docs.basex.org/wiki/Jobs_Module

I think the solution is to get all the files to be loaded then start a new asychronous job to do the pull from gitlab. This also enables monitoring the jobs.

ludocracy commented 7 years ago

Okay, I can correct the blind pull parameter posting. Once that kicks off the REST function, if I understand the Jobs Module docs correctly, any asynchronous job should not block the curl i.e. jobs:eval(“db:add(…)”) should still allow linkmgr:addFile() to return a response. I’ll re-implement and test this weekend.

On Jun 17, 2017, at 9:39 AM, Eliot Kimber notifications@github.com wrote:

Pull request for background update with pull from gitlab by link mgr.

You can view, comment on, or merge this pull request online at:

https://github.com/dita-for-small-teams/dfst-linkmgmt-basex/pull/5 https://github.com/dita-for-small-teams/dfst-linkmgmt-basex/pull/5 Commit Summary

added post update response method linkmgr:addFile syntax correct File Changes

M webapp/linkmgrViews.xqm https://github.com/dita-for-small-teams/dfst-linkmgmt-basex/pull/5/files#diff-0 (115) Patch Links:

https://github.com/dita-for-small-teams/dfst-linkmgmt-basex/pull/5.patch https://github.com/dita-for-small-teams/dfst-linkmgmt-basex/pull/5.patch https://github.com/dita-for-small-teams/dfst-linkmgmt-basex/pull/5.diff https://github.com/dita-for-small-teams/dfst-linkmgmt-basex/pull/5.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dita-for-small-teams/dfst-linkmgmt-basex/pull/5, or mute the thread https://github.com/notifications/unsubscribe-auth/ANZMvI756huqAeOA7Bs66HkpEQjTUZT2ks5sE-UKgaJpZM4N9PeY.