-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use mongosh connection to ocrd-database for job infos #62
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good too. I can only perform a functional test after my vacation.
039567a adds a simple web server (via There are
Usage is simple: just convert any of the command-line args to CGI query options, e.g.
this will automatically translate to
We now should document this, add some more logging, and start with a call-back interface (see #64). |
@bertsky I tried out this feature and encountered the problem that constructing the JSON for Mongo fails as there seems to be linebreaks in the JSON. Maybe i introduced some problems while a was copying the logic for my tests, so that some unwanted line breaks got injected? Line 71 in 52587e9
terminating with error $?=1 from HOME=/tmp mongosh --quiet --norc --eval "use ocrd" --eval "db.OcrdJob.insertOne( {#012 pid: $PID,#012 time_created: ISODate(\"$(date --rfc-3339=seconds)\"),#012 process_id: \"$PROCESS_ID\",#012 task_id: \"$TASK_ID\",#012 process_dir: \"$PROCESS_DIR\",#012 workdir: \"$WORKDIR\",#012 remotedir: \"$REMOTEDIR\",#012 workflow_file: \"$WORKFLOW\",#012 controller_address: \"$CONTROLLER\"#012 } )" $DB_CONNECTION on line 83 /usr/bin/ocrd_lib.sh For the moment i formatted it in a way to have everything in one line. Edit: It indeed seems like i introduced some problems whily copying. It works now |
first attempt (still using bash for everything, so DB access only via mongosh)
It looks like when you restart a job for the same workspace, the new active job is not shown because internally it gets confused with the previous job for that workspace – so we probably need to redefine the index.