Closed VMois closed 3 years ago
In the get_workflows API when include_progress is not passed (= False), job progress is still queried from DB.
get_workflows
include_progress
Listing from get_workflow_progress function:
Jobs are queried at the beginning:
https://github.com/reanahub/reana-workflow-controller/blob/d650d0c059ff17bd3b62d5e34addfa1af9e24c1c/reana_workflow_controller/rest/utils.py#L636-L641
But only used and may be included only here:
https://github.com/reanahub/reana-workflow-controller/blob/d650d0c059ff17bd3b62d5e34addfa1af9e24c1c/reana_workflow_controller/rest/utils.py#L658-L671
In case the user doesn't want to include progress, unnecessary queries are still performed. For 1000 workflows, it potentially increases response time a lot.
Good catch. Also, that try-except is not very pretty.
try-except
In the
get_workflows
API wheninclude_progress
is not passed (= False), job progress is still queried from DB.Listing from get_workflow_progress function:
Jobs are queried at the beginning:
https://github.com/reanahub/reana-workflow-controller/blob/d650d0c059ff17bd3b62d5e34addfa1af9e24c1c/reana_workflow_controller/rest/utils.py#L636-L641
But only used and may be included only here:
https://github.com/reanahub/reana-workflow-controller/blob/d650d0c059ff17bd3b62d5e34addfa1af9e24c1c/reana_workflow_controller/rest/utils.py#L658-L671
In case the user doesn't want to include progress, unnecessary queries are still performed. For 1000 workflows, it potentially increases response time a lot.