Use asyncio subprocess interface in webservice code
Description
Using the blocking subprocess
module in async code means stopping everything else while a subprocess runs. The equivalent asyncio interfaces allow other tasks to continue. This is a minor issue, as we're not using long-running subprocesses, but it cleans up some FIXMEs.
How Has This Been Tested?
It hasn't. I don't actually know how to get it set up to test. :-( Followed instructions from @danilevc to run it as xcaltst on max-exfl017 and trigger recalibration of some CALLAB data.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
- My code follows the code style of this project.
Reviewers
Merge request reports
Activity
yay! It's looking good.
If that's fine with you, I could set it up onxcaltst@max-exfl017
and do a few requests using CALLAB data from the test metadata catalog.This is done by going to
xcaltst@max-exfl017
, and doing:ssh xcaltst@max-exfl017 cd /home/xcaltst/pycalibration git checkout /home/xcaltst/pycalibration ps aux | grep webservice/webservice.py | awk '{ print $2}' | xargs kill source /home/xcaltst/pycalibration_venv/bin/activate /home/xcaltst/pycalibration_venv/bin/python /home/xcaltst/pycalibration/webservice/webservice.py --mode prod --logging INFO --config-file /home/xcaltst/pycalibration/webservice/webservice.yaml
added 2 commits
added 2 commits
Thanks @danilevc. I'll try that after lunch.
I guess I'm meant to use some other copy of the yaml config, not the one that's checked into the repo, because that seems to be configured to use production servers & locations rather than test ones. I see one at
~/webservice_save.yaml
, and one at~/pycalibration/save/webservice.yaml
- is it either of those?mentioned in commit 51adb1de