Closed Abe410 closed 1 year ago
Hi,
I am using measures.get_component_with_specified_measures to connect to the relevant endpoint to get the metrics of a project.
measures.get_component_with_specified_measures
Thing is, I am doing this right after I run a scan, and for bigger projects, this can take some time.
So for those projects, my script then fails and gives an error.
I could implement a time.sleep() method to pause execution of the script for a while, but this is not needed for smaller code scans.
Is there any way I can check from the API itself if the analysis and background tasks have been completed or not?
You can use the search_tasks to get the background tasks status. for example: tasks = client.ce.search_tasks(componentId="AYPE5_SBK_hfsDL1XEIN", status="IN_PROGRESS,SUCCESS,FAILED,CANCELED")
tasks = client.ce.search_tasks(componentId="AYPE5_SBK_hfsDL1XEIN", status="IN_PROGRESS,SUCCESS,FAILED,CANCELED")
Hi,
I am using
measures.get_component_with_specified_measures
to connect to the relevant endpoint to get the metrics of a project.Thing is, I am doing this right after I run a scan, and for bigger projects, this can take some time.
So for those projects, my script then fails and gives an error.
I could implement a time.sleep() method to pause execution of the script for a while, but this is not needed for smaller code scans.
Is there any way I can check from the API itself if the analysis and background tasks have been completed or not?